I have been unable to correctly get the Music Selection to show up. What I ultimately want to do, is to be able to pick a number of songs, and then return the selected song data to use like a playlist.
I was unable to get the following code to work:
public MPMediaPickerController Picker
void OnClick()
{
Picker = new MPMediaPickerController();
Picker.allowsPickingMultipleItems = true;
Picker.PresentViewController(Picker,true,null)
}
The problem comes from the PresentViewController, and Objective-C examples show a difference when using “self” to present the view controller. I tried using “this.Picker” but was unnable to get it to work. The crash when OnClick() is fired is something along the lines of “Tried to present modal view on itself”.
I also read that another problem is calling the picker over unity, and it simply not showing up; this might have also been the case as I tried Picker.PresentViewController(Picker.presentedViewController,true,null) and Xcode had some log text show up, but nothing happened on the phone.
If anyone knows how to fix it (and also how to use the MPMediaPickerControllerDelegate class to return the picked songs) that would be amazing.
Thanks,
Blueteak