1

In the sparse Apple StoreKit Docs it mentions using a clientToken to request a personalizationToken from a device via requestPersonalizationToken.

There is no accompanying documentation to describe what this token should be. I had assumed that it should take the form of a developer JWT token but that does not appear to work, giving the error SKErrorDomain code 8 with a nil token response.

I know that the token works for a regular call to the Music API and so assume it is of the correct format for a developerToken.

I am aware that Apple are not giving out tokens via requestUserTokenForDeveloperToken until later in the year but assumed that requestPersonalizationToken was the current (although already deprecated) method until iOS 11 is released.

Community
  • 1
  • 1
Moss Palmer
  • 1,814
  • 1
  • 15
  • 30

2 Answers2

0

Apple Music sample code is using "requestPersonalizationToken forClientToken" for pre iOS 11 devices. The sample is passing MusicKit developerToken in JWT form for client token.

Bahri Okuroglu
  • 178
  • 1
  • 7
  • Thanks Bahri. That is the source code that I am looking at but it doesn't work. I have known there to be errors in Apples Source code listing in the past and wanted to find a definitive location that points to the token. E.g. the Token is named differently to the iOS11 equivalent (clientToken vs developerToken). – Moss Palmer Jul 03 '17 at 10:02
  • You are right Moss, having it in the sample code does not have to mean it is the correct way. After your comment, I just checked the sample code on two iOS 10.3 devices and saw requestPersonalizationTokenForClientToken call is ending with error (SKErrorDomain, code:8). – Bahri Okuroglu Jul 03 '17 at 14:28
0

For any others that hit this thread.

Yes, the token is the same format. Apple have recently pushed an update out that resolves the issues that I was encountering. The exact same code now successfully retrieves a UserToken.

Moss Palmer
  • 1,814
  • 1
  • 15
  • 30