0

I have my iOS app with StoreKit. I'm trying to get access to the user's personal library through

https://api.music.apple.com/v1/me/library/artists?offset=

Earlier, I created a developer token that should not expire. Then, after gaining access to AM, I request the AM personalized content token using the method:

SKCloudServiceController().requestUserToken(forDeveloperToken: String, completionHandler: @escaping (String?, Error?) -> Void)

And it returns token without error.

But the next request to the library with both of the above tokens in the request header returns 401, which means that something is wrong with the developer token.

Headers of request:

"Content-Type": "application/json",
"Authorization": "Bearer [developer token]",
"Accept-Language": "...",
"User-Agent": "...",
"Accept": "application/json",
"Music-User-Token": "[user token]",
"Accept-Encoding": "..."

Could it be that the developer token works to create a user token, but is incorrect?

Maxim
  • 33
  • 6

1 Answers1

1

The problem was the excessively long expiration of the tokens I made. The developer token cannot be longer than 6 months.

Maxim
  • 33
  • 6