MPMusicPlayerController applicationMusicPlayer issues

Hi,


I was working on a music player application and facing few issues with MPMusicPlayerController applicationMusicPlayer.

Issue 1) When Apple "Music" app was killed on iPhone then song audio stops playing on my app as well no matter my app is running in foreground or background.

Issue 2) When Apple "Music" app was uninstalled from iPhone then the applicationMusicPlayer does not play songs on my app.

Issue 3) I am using MPCommandCenter to handle lock screen buttons. This is the code I am using [[UIApplication sharedApplication] beginReceivingRemoteControlEvents]; [self becomeFirstResponder]; [MPRemoteCommandCenter sharedCommandCenter].playCommand.enabled = YES; [[MPRemoteCommandCenter sharedCommandCenter].playCommand addTarget:self action:@selector(remotePlay)]; . But the selector method is never triggered and also I am not able to disable the lock screen controls.


I am completely struck with these issues. Can you please provide some documentation or guide me to resolve this issues.


Thanks,

Dashmeet

Replies

Have you found any information that has helped you? I am experiencing unexpected behavior as well when using applicationMusicPlayer while straming Apple Music tracks.

Hey!

I'm building music app using new APIs and I have simple conclusion:


New APIs for Music are ... joke. Really. They don't allow to built anything new, they're written for some big companies like Nike or Runkeeper to throw more s*** in their fitness apps, because you can't really do anything with those APIs unless:

- music app wasn't killed by the user,

- music app wasn't uninstalled,

- your app is on foreground,

- user is changing the playback/tracj from your app (not from the control center),

- use some "hacks" to leave your app alive in background (and count that App Store review won't reject the app in the first place) and unnecesairly consume battery.

Any update on this? The applicationMusicPlayer in IOS 11 is hopelessly broken and does not match the documentation in its behavior. Groan.