Apple Music API not letting me get User Token - Throwing Unknown Error

955 views Asked by At

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

There are 1 answers

4
Nick Sorge On

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