MusicKit Dev Token Refresh

I am trying to follow along with this in order to auto generate my dev token on requests to MusicKit, but I am getting an error about by identifier, which was configured

Link:

https://developer.apple.com/documentation/musickit/using-automatic-token-generation-for-apple-music-api

Error: 2022-04-26 14:12:06.353589-0400 [6885:431407] [DataRequesting] Failed retrieving developer token: Error Domain=ICErrorDomain Code=-8200 "Media API Token Service responded with status code: Not Found (404). This suggests that "<set_bundle_ID>" was likely not registered as a valid client identifier." UserInfo={NSDebugDescription=Media API Token Service responded with status code: Not Found (404). This suggests that "<set_bundle_ID>" was likely not registered as a valid client identifier., NSUnderlyingError=0x2827669a0 {Error Domain=AMSErrorDomain Code=301 "Invalid Status Code" UserInfo={NSLocalizedDescription=Invalid Status Code, AMSURL=https://sf-api-token-service.itunes.apple.com/apiToken?REDACTED, AMSStatusCode=404, AMSServerPayload={

    message = "Client not found";

    status = 40402;

}, NSLocalizedFailureReason=The response has an invalid status code}}}. Throwing .developerTokenRequestFailed.

error getting token

Replies

Hello @mikemgg123,

Please visit the Certificates, Identifiers, and Profiles section of the developer website, in the Identifiers subsection, open the App ID for your app and begin editing its configuration.

Then, please confirm that the value of Bundle ID field in this page matches exactly with the bundle ID of your application (redacted in your logs as <set_bundle_ID>).

Based on the log you're seeing, I believe there must me some kind of a mismatch.

I hope this helps.

Best regards,

Hi, having the same issue but the bundle ID does not appear on the list under the Identifier subsection. Why is that? and how do i get the bundle ID to show? thank you.

Hello @MKDeveloper,

If your bundle ID doesn't appear on that list, it's probably because it's a brand new app, and you haven't created it yet.

Please visit the Certificates, Identifiers, and Profiles section of the developer website, and press the blue button with a "+" sign.

I hope this helps.

Best regards,

Hi, experiencing this issue when the bundle ID is created and configured.

My app's identifier on the developer website matches the bundle ID in Xcode. When my code makes any request to the Apple Music catalog, it still throws this error:

Media API Token Service responded with status code: Not Found (404). This suggests that <redacted> was likely not registered as a valid client identifier.
Failed retrieving tokens for MusicDataRequest.Context(url: "https://api.music.apple.com/v1/storefronts/nz"). Error = .developerTokenRequestFailed.

Is there any way to resolve this?