0
votes

I am trying to create a very simple app using Apple's Apple Music API in Swift. To do this, I need to retrieve songs from Apple Music. I am trying to get a user token using this code

        SKCloudServiceController().requestUserToken(forDeveloperToken: "[DEV TOKEN HERE]") { (userToken, err) in
            if let e = err {
                print(e)
            }
            
                if let token = userToken {
                    print(token)
                }
            }

Right now I am just trying to print the token, but every time I call this function I am met with this error in console

Error Domain=SKErrorDomain Code=0 "An unknown error occurred" UserInfo={NSLocalizedDescription=An unknown error occurred}

I am confident that it is not my Dev Token because that usually throws a 'Cannot Connect to iTunes' error and I have tried substituting random strings for my dev token just to get the same error.

I've looked around but I cannot find an answer to this, has anyone else encountered it or have any idea how to fix it? Thank you!

P.S I am not too familiar with posting on Stack Overflow so if I made some mistake please let me know so I can correct it!

1
Were you able to fix this issue? Did changing the dev token work for you? I'm STILL having this issue and we're on iOS 14.4 now... I found others having problems such as this around 2 months ago. - Beau Nouvelle

1 Answers

0
votes

Same here. It worked before 14.2. Developer Token is valid, I checked Dev Center.