I am attempting to use Apple’s MusicKit SDK for Android. Adding their authorization SDK went fine, and I can launch the Apple Music app to request authorization. However, I keep getting TOKEN_FETCH_ERROR
in the response, suggesting that Apple does not like my developer token.
In my call to createIntentBuilder()
on Apple’s AuthenticationManager
, where I am supposed to pass my developer token, what exactly is that token?
The .p8
file that I got from developer.apple.com
is an encoded certificate, with four encoded lines between the -----BEGIN PRIVATE KEY-----
and -----END PRIVATE KEY-----
. I am under the impression that we are to use this .p8
file as the developer token, but I have tried each of the following:
- The verbatim contents of the
.p8
file, including all newlines - The contents consolidated onto one encoded line between the
BEGIN
andEND
lines - Just the encoded contents, all on one line
None seem to work — they all give me TOKEN_FETCH_ERROR
responses. The key itself is enabled for “Media Services (MusicKit, ShazamKit, Apple Music Feed)”, which feels like the right option.