I am trying to play songs on iOS 14 using Apple Music API. I have the developer's token, and I have asked for the permission for accessing the user's apple music.
However, when I call requestusertoken api, its closure never gets called, so obviously I don't receive anything from the request - not even an error. It's driving me crazy!!
Here is my code. What am I doing wrong?
However, when I call requestusertoken api, its closure never gets called, so obviously I don't receive anything from the request - not even an error. It's driving me crazy!!
Here is my code. What am I doing wrong?
Code Block swift func getUserToken() -> String { var userToken = String() let lock = DispatchSemaphore(value: 0) SKCloudServiceController().requestUserToken(forDeveloperToken: developerToken) { (receivedToken, error) in guard error == nil else { return } if let token = receivedToken { userToken = token lock.signal() } } lock.wait() return userToken }