Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MPMediaPickerController shows an empty screen on iOS10

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?

like image 483
Fabrizio Bartolomucci Avatar asked Jun 27 '16 11:06

Fabrizio Bartolomucci


2 Answers

Add Key-value to Plist :

<key>NSAppleMusicUsageDescription</key> 
<string>$(app Name) uses music</string>
like image 51
Vikesh Prasad Avatar answered Nov 18 '22 14:11

Vikesh Prasad


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

like image 29
Fabrizio Bartolomucci Avatar answered Nov 18 '22 14:11

Fabrizio Bartolomucci