iOS is not asking user for Photo Library Permission anymore. Even when I deleted the app from the device. This also happens on Simulator.
switch ([ALAssetsLibrary authorizationStatus])
{
case ALAuthorizationStatusAuthorized:
RPMLog(@"authorized");
break;
case ALAuthorizationStatusDenied:
RPMLog(@"denied");
break;
case ALAuthorizationStatusNotDetermined:
RPMLog(@"not determined");
break;
case ALAuthorizationStatusRestricted:
RPMLog(@"restricted");
break;
}
I'm already authorized when I install the app for the first time. Prior to this, there's no other event or screen that asks for the photos to trigger the user prompt.
Then I request the numberOfAssets in SavedPhotos and get it without the access prompt:
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
if (!group) return;
UIActionSheet *actionSheet = nil;
if (([group numberOfAssets] > 0))
{
actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) destructiveButtonTitle:nil otherButtonTitles:NSLocalizedString(@"Take new photo", nil), NSLocalizedString(@"Use last photo taken", nil), NSLocalizedString(@"Choose existing", nil), nil];
}
else
{
actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) destructiveButtonTitle:nil otherButtonTitles:NSLocalizedString(@"Take new photo", nil), NSLocalizedString(@"Choose existing", nil), nil];
}
actionSheet.actionSheetStyle = UIActionSheetStyleBlackTranslucent;
[actionSheet showFromTabBar:self.tabBar];
[TestFlight passCheckpoint:@"New Look: Tab Bar"];
} failureBlock:^(NSError *error) {
NSAssert(!error, [error description]);
}];
As the question is for Photo Library permissions, there is other way without changing the system clock and turning the device off.
You can just go to "Settings" app
(General > Reset > Reset Location & Privacy).
This will make the apps ask for photo library, location and other permissions again.