MPMediaQuery

Originator:ben
Number:rdar://27630648 Date Originated:2016-07-31
Status:Open Resolved:
Product:iOS10 Product Version:iOS 10 Public beta 2 (10.0 14A5309d)
Classification: Reproducible:
 
Summary:
We are querying the user's music library, using a MPMediaQuery

Upon activating this, a prompt is shown in iOS10 asking for permission to access the user's media library, however the MPMediaQuery continues to run whilst the prompt is showing, returning no results (assumes no permission)

If you accept the permissions prompt and re-run, it works fine

As there is no documented way of us asking for permission, any automated request must therefore wait for the permission prompt to be either agreed or dismissed, before the underlying code can run - otherwise the user gets unexpected results

Steps to Reproduce:
Run a MPMediaQuery


Expected Results:
Permission prompt shows, then code runs if permission is granted

Actual Results:
Permission prompt shows, then code runs instantly without user accepting/denying prompt. As such, first run of code always returns no results

Version:
iOS 10 Public beta 2 (10.0 14A5309d)

Comments

Can you not use the +[MPMediaLibrary requestAuthorization:] API?


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!