iOS 9.3.2 Breaks MPMusicPlayerController
Asked Answered
M

0

7

I'm trying to integrate Apple Music to my app, I managed to get it working flawlessly until this morning.

After updating to iOS 9.3.2 nothing is the same:

The permission system works the same (SKCloudServiceController) to retrieve the AuthorizationStatus and Capability of the user.

However, the MPMusicPlayerController do not behave the same using the new iOS version, let me explain :

  • On iOS 9.3.1, if I call the playerController.play() method after setting my tracks in playerController.setQueueWithStoreIDs(:_), I immediately receive the MPMusicPlayerControllerNowPlayingItemDidChangeNotification with the playerController.indexOfNowPlayingItem equal to 0 and the music is playing normaly.

  • On iOS 9.3.2, if I call the playerController.play() method after setting my tracks in playerController.setQueueWithStoreIDs(:_), I immediately receive the MPMusicPlayerControllerNowPlayingItemDidChangeNotification with the playerController.indexOfNowPlayingItem equal to NSNotFound and the music not playing.

I checked this behavior on iPhone 6, 6s, 6s+, and 5S. On iOS 9.3.1 everything works and the behavior is extremely unlikely to succeed in 9.3.2 (it works like 1% of the time).

I also looked up some app already offering the Apple Music integration on the Store, the result is the same, the apps are not working properly on iOS 9.3.2. That's why I filled a bug report to Apple.

If anybody has a solution to this problem, I'd love to hear it !

!!! Update !!! :

I just noticed that MPMusicPlayerController.setQueueWithStoreIDs(_:) just disappeared from the documentation this morning :O, it was there since March 21 2016 !

It's still THERE

Maddis answered 17/5, 2016 at 16:16 Comment(3)
This whole class is totally screwed. I can't get lock screen controls to work either. Have you?Mark
@Mark I can "hack" my way with the systemMusicPlayer but you have absolutely no luck with the applicationMusicPlayer, either in the remoteControlReceivedWithEvent in the AppDelegate or by trying to register them with the MPRemoteCommandCenter...Maddis
I know, I too tried a hacky way with system music player. When a song ends, I just play the next song. But the previous button does the same thing! This is so bad.Mark

© 2022 - 2024 — McMap. All rights reserved.