I am trying to let people like tracks, albums or playlists on Apple Music from a webpage.
I understand the manual on this page: https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/AppleMusicWebServicesReference/SetUpWebServices.html
Until I hit the part where I should use the requestUserToken(forDeveloperToken:completionHandler:)
method from SKCloudServiceController in the StoreKit framework, since there is no StoreKit framework available for outside iOS/macOS/tvOS/etc.
How is this token generated? Is there any other way I can generate this Music User Token manually?
I know it is a (very) longshot, but maybe someone figured it out!
To generate the user token (a MusicKit private key in a *. p8 file, a 10-digit key identifier in your Apple Developer account and your 10-digit Apple Developer Account Team ID), you can visit Apple member centre. If you have a member account, you can proceed with the generating the stuffs.
There are two paths to generate developer tokens: If you're developing an app for Apple platforms (iOS, tvOS, watchOS or macOS), the recommended way to integrate with Apple Music is to use MusicKit for Swift, following the steps provided in Using Automatic Developer Token Generation for Apple Music API.
Price: The API is offered free to participants in the Apple's Affiliate Program, which allows them to earn commissions on any qualifying sales. Popularity: Apple Music is a popular service around the world, especially for iOS users.
Tokens are physical devices built in to the system, located on attached hardware (like a smart card), or accessible through a network connection. Tokens store cryptographic objects like keys and certificates.
The new Apple MusicKit JS library allows you to create Music User Token's from your Developer Token as seen here outside of iOS. Once you've loaded the Library you can use the authorize
method to allow a user to authenticate and generate a token.
document.addEventListener('musickitloaded', function() {
// MusicKit global is now defined
MusicKit.configure({
developerToken: 'DEVELOPER-TOKEN',
app: {
name: 'My Cool Web App',
build: '1978.4.1'
}
});
let music = MusicKit.getInstance();
music.authorize().then(musicUserToken => {
console.log(musicUserToken);
});
});
I have tried the approach within my iOS app.
You can follow this link generate music token
This is basically python script. You can easily create a music developer token from your mac.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With