There is a serious flaw in the data sharing permissions flow that gives apps access to personal data before the user has granted permission. This is because the data-sharing permission request has been moved from the presentation of the media picker to the delegate method called after the items have been picked. This gives apps access to personal media metadata even if permission is denied by the user.
It's also very obvious to the user that something is wrong because they tap "add music" or "add photos" on an app they just installed and instead of seeing the data-sharing permission request that they're used to seeing they now go straight to the media picker and can select items.
In iOS <=12 if your app wanted to access the user's personal media the user was asked to grant Data Sharing Permissions when the MPMediaPickerController was presented:
Use taps a button to "Add Music" from their iTunes library to a playlist in the app, this triggers the creation and presentation of a media picker controller. But before it displays their media library it shows the Data Sharing Request dialog where the user can tap "Don't Allow" or "OK"
MPMediaPickerController *picker = [[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeMusic];
picker.delegate = self;
picker.allowsPickingMultipleItems = YES;
[[mainViewController] presentViewController: picker animated: YES completion:nil];
>>> Here is where the user would see the data sharing permission request in iOS 12--before they or the app actually see the media selection.
* In iOS 13, however, the data-sharing permission request does not appear until the app's didPickMediaItems delegate method is called (it's a delegate used by MPMediaPickerController). So the app is able to browse the user's data before permission has been granted.
- (void)mediaPicker: (MPMediaPickerController *)mediaPicker didPickMediaItems:(MPMediaItemCollection *)mediaItemCollection {
>>> Here is where the user is asked to grant data sharing permission in iOS 13
But the users' privacy has already been violated at that point. And because the items have already been selected, the app is able to access the media metadata even if the user Denies the data sharing request.