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?

Fabrizio Bartolomucci
  • 4,948
  • 8
  • 43
  • 75

2 Answers2

39

Add Key-value to Plist :

<key>NSAppleMusicUsageDescription</key> 
<string>$(app Name) uses music</string>
Vikesh Prasad
  • 779
  • 7
  • 13
5

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

Fabrizio Bartolomucci
  • 4,948
  • 8
  • 43
  • 75