0

Is it possible in iOS 11 with the new MusicKit API (or any other iOS API) to create a music player and have it displayed on the iPhone's lock screen, like the current Apple Music player? If so, how -- what APIs should be used?

andrewz
  • 4,729
  • 5
  • 49
  • 67
  • Do you mean, play the user's songs on your app? and allow him to control them from the lock screen as well? or do you mean replace the music player shown in the lock screen with a different design? – Pochi Aug 03 '17 at 03:28
  • The first - play user's songs on my app and allow control of my app from the lock screen as my app is playing the music. – andrewz Aug 03 '17 at 03:31

1 Answers1

1

The first - play user's songs on my app and allow control of my app from the lock screen as my app is playing the music.

This is possible, the Music Kit API allows you to access the user's library:

MusicKit on iOS lets users play Apple Music and their local music library natively from your apps and games. When a user provides permission to their Apple Music account, your app can create playlists, add songs to their library, and play any of the millions of songs in the Apple Music catalog. If your app detects that the user is not yet an Apple Music member, you can offer a trial from within your app.

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

Regarding the controls from the lock screen. That can be done without using that SDK, its simply filling the "MPNowPlayingInfoCenter"

Refer to this one for it: iOS: Displaying currently played track info in LockScreen?

Pochi
  • 13,391
  • 3
  • 64
  • 104
  • I want my app to be displayed on the lock screen, that means my own design -- for example I want to add a "repeat" and "shuffle" buttons there. Can this be done? How? I prefer to provide my own view controller if possible. – andrewz Aug 03 '17 at 04:50
  • 1
    That's not possible. – Pochi Aug 03 '17 at 04:51