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
}