MPMediaLibrary

When we add item to playlist with productId then my app is hang/Stuck.

Below is the code :

MPMediaLibrary.default().getPlaylist(with: playlistUUID, creationMetadata: playlistCreationMetadata) { (playlist, error) in
Code Block
guard error == nil else {
fatalError("An error occurred while retrieving/creating playlist: \(error!.localizedDescription)")
}
print(playlist?.persistentID)
for item in self.songArray{
playlist?.addItem(withProductID: item.song_apple_id ?? "", completionHandler: nil)
}
}

And get this log:

2020-12-17 12:16:45.279026+0530 Mix-Tape[3258:1283585] [iTunesCloud] warning: ICUserIdentity - Resolving DSID without an externally supplied identity store; if encoding the identity into an NSCoder, make sure to use -[NSCoder icencodeUserIdentity:withStore:forKey:]
. Falling back to using [ICUserIdentityStore defaultIdentityStore].
Optional(4489660233961424741)
2020-12-17 12:17:01.370476+0530 Mix-Tape[3258:1284258] [tcp] tcp
input [C8.1:3] flags=[R] seq=3361714150, ack=0, win=0 state=LASTACK rcvnxt=3361714150, snd_una=357400339
I noticed no one has replied so I thought I'd offer my thoughts. I suspect this is related to this bug:
https://developer.apple.com/forums/thread/658557
that causes a similar freeze.
If it's related, good news: you're not alone || bad new: it's been an outstanding bug for over 4 months with no guidance or help from Apple on when / if it will be fixed.
Sorry to be the bearer of bad news, but know how tough it is to have asked a question and get no response.
MPMediaLibrary
 
 
Q