Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
fix(permissions): iOS 11+ doesn't need permissions for picking a sing…
Browse files Browse the repository at this point in the history
…le image
  • Loading branch information
tomasharkema authored and Johan-dutoit committed Aug 30, 2019
1 parent 454fff3 commit e9e0f87
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions ios/ImagePickerManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,18 @@ - (void)launchImagePicker:(RNImagePickerTarget)target
}];
}
else { // RNImagePickerTargetLibrarySingleImage
[self checkPhotosPermissions:^(BOOL granted) {
if (!granted) {
self.callback(@[@{@"error": @"Photo library permissions not granted"}]);
return;
}
if ([[[UIDevice currentDevice] systemVersion] floatValue] < 11) {
[self checkPhotosPermissions:^(BOOL granted) {
if (!granted) {
self.callback(@[@{@"error": @"Photo library permissions not granted"}]);
return;
}

showPickerViewController();
}];
showPickerViewController();
}];
} else {
showPickerViewController();
}
}
}

Expand Down

0 comments on commit e9e0f87

Please sign in to comment.