iOS 9.3.2 Breaks MPMusicPlayerController

十年热恋 提交于 2019-12-20 10:53:58

问题


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

来源:https://stackoverflow.com/questions/37281520/ios-9-3-2-breaks-mpmusicplayercontroller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!