MPMediaLibrary requestAuthorization does not call callback

I have the following code in our app:

[ MPMediaLibrary requestAuthorization: ^( MPMediaLibraryAuthorizationStatus status )

{

// stuff

} ];


And the first time per session we invoke this, the "//stuff" gets executed just fine. But the second and onward times we call this, the callback never gets called. If we force close the app and restart it, it will work correctly (once) and then not work anymore that session. This repros on iOS 12 but not on iOS 11.


Did the API change? Should I change my code to:

if ( MPMediaLibrary.authorizationStatus == MPMediaLibraryAuthorizationStatusNotDetermined )

{

[ MPMediaLibrary requestAuthorization: ^( MPMediaLibraryAuthorizationStatus status )

{

// stuff

} ];

}

else

{

// if MPMediaLibrary.authorizationStatus == MPMediaLibraryAuthorizationStatusAuthorized

// music stuff

// else

// cant do music stuff, tell use to go to settings

}

Replies

Do you have any news about that? Same issue for me today 😟

I was hoping this forum could help out 😁

Should I file an official bug report? Or is it behaving "as intended"? It seems strange that it would change so drastically from iOS 11 to iOS 12.

Yes, could you file a bug report and post the number here?


It's fine to skip the authorization request if the authorization status is already known, so the workaround you proposed is a good solution for now.

Can you point me in the proper direction to do that? It says Bug Reporter is no longer available... https://developer.apple.com/bug-reporting/

You should be able to get to the new Feedback Assistant through this direct link:


feedbackassistant.apple.com

OK, I think I submitted it, is this the number? FB6421210

Apple replied about five days ago asking for an example app that demonstrates the issue, so I replied to them, but haven't heard anything... Hopefully they get to the bottom of it. It sounds like this is an even bigger issue in iOS 13?

Thank you doing this! I was just going to file a bug report myself, because this makes my app unable to be tested on my beta iOS 13 devices. I might still do it anyway to bring more awareness to this issue.

Yes, the more people submitting bug reports the better. I haven't heard back from Apple since July 5th.

Looks like the feedback ticket status has silently changed to

"Recent Similar Reports:More than 10

Resolution:Potential fix identified - For a future OS update"


So at least Apple knows about it now

It was reported as fixed in this thread:


https://forums.developer.apple.com/message/370102


I didn't realize there were 2 threads about this, otherwise I would have reported this here earlier.