Apple Music Api Available?

I am making a media player for Apple iOS and wanted it to be able to pull my music library using an API. The closest thing I found to this is this:

https://developer.apple.com/musickit/

However, I don't know if it will allow users to play their music purchased by apple. Does anyone know how to do this so the user logs into their apple account through my app and then has complete access to their movies, tv shows, and music?

Any answers are really appreciated I did my best to find the answer to this and know its annoying to ask these questions when google or apple has it documented somewhere.

Accepted Reply

Hello @Xylapple,

MusicKit is available as a framework in the iOS SDK, and allows you to play music from the user's music library (whether it was purchased or added to their library via other means), or from the Apple Music catalog, assuming the user is allowed to play subscription content.

You can use one of two players, depending on the requirements for your app: ApplicationMusicPlayer or SystemMusicPlayer.

On iOS, you will not need to ask the user to log into their Apple account through your app, because MusicKit automatically uses the active account of the user on that device. However, you will need to ask the user for their informed consent to grant your app access to their Apple Music data, using the MusicAuthorization.request() function.

The one thing you asked about which isn't available via MusicKit is the user's movies or TV shows. I'm assuming you're referring to regular movies or TV shows, and those are simply part of other services, separate from Apple Music.

I would highly encourage you to check out our introductory WWDC session about MusicKit: Meet MusicKit for Swift. This will give you a quick overview of what the framework offers, and how you can use it.

For more information about brand new features we're adding in iOS 16, please check out our latest WWDC session: Explore more content with MusicKit.

I hope this helps.

Best regards,

Replies

Hello @Xylapple,

MusicKit is available as a framework in the iOS SDK, and allows you to play music from the user's music library (whether it was purchased or added to their library via other means), or from the Apple Music catalog, assuming the user is allowed to play subscription content.

You can use one of two players, depending on the requirements for your app: ApplicationMusicPlayer or SystemMusicPlayer.

On iOS, you will not need to ask the user to log into their Apple account through your app, because MusicKit automatically uses the active account of the user on that device. However, you will need to ask the user for their informed consent to grant your app access to their Apple Music data, using the MusicAuthorization.request() function.

The one thing you asked about which isn't available via MusicKit is the user's movies or TV shows. I'm assuming you're referring to regular movies or TV shows, and those are simply part of other services, separate from Apple Music.

I would highly encourage you to check out our introductory WWDC session about MusicKit: Meet MusicKit for Swift. This will give you a quick overview of what the framework offers, and how you can use it.

For more information about brand new features we're adding in iOS 16, please check out our latest WWDC session: Explore more content with MusicKit.

I hope this helps.

Best regards,

Exactly the answer I was looking for, thank you for taking the time to write a thorough, clear response.