MPMediaPickerController shows an empty screen on iOS10
Asked Answered
M

2

9

I am trying to port my apps to iOS 10, including the visualization of a MPMediaPickerController by means of the following code:

@IBAction func handleBrowserTapped(_ sender: AnyObject){
    let pickerController = MPMediaPickerController(mediaTypes: .music)
    pickerController.prompt = NSLocalizedString("Add pieces to queue", comment:"");
    pickerController.allowsPickingMultipleItems=true;
    pickerController.delegate=MPMusicPlayerControllerSingleton.sharedController();
    self.present(pickerController, animated:true, completion:{
        MPMusicPlayerControllerSingleton.sharedController().storeQueue()
    })
}

Yet all that appears on the screen is a full white screen with no back buttons or other, differently from the previous iOS versions. The block is called and so the picker's presentation seems to succeed. What could be the problem?

Mandolin answered 27/6, 2016 at 11:37 Comment(0)
M
5

The issue was fixed by the latest beta now asking for an authorisation to access the iTunes library.

Mandolin answered 9/7, 2016 at 11:11 Comment(0)
M
39

Add Key-value to Plist :

<key>NSAppleMusicUsageDescription</key> 
<string>$(app Name) uses music</string>
Mciver answered 18/8, 2016 at 8:15 Comment(4)
I am doing the same but not even the popup comes. Is there anything else I need to consider to make it work ?Bootstrap
Which Xcode You are Using ?? Please Try on Device if it is Xcode 8.2, Xcode 8.2 beta or Xcode 8.2.1.Mciver
@Bootstrap use Privacy - Media Library Usage Description keyFrancophile
Thank you - this helped me a lot also!Roadster
M
5

The issue was fixed by the latest beta now asking for an authorisation to access the iTunes library.

Mandolin answered 9/7, 2016 at 11:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.