Skip to content

Commit

Permalink
Add missing case values in permissions check switches (granted for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
zoontek committed Sep 26, 2020
1 parent 39900f4 commit ff4b399
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ios/Notifications/RNPermissionHandlerNotifications.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,16 @@ - (void)checkWithResolver:(void (^ _Nonnull)(RNPermissionStatus status, NSDictio

switch (settings.authorizationStatus) {
case UNAuthorizationStatusNotDetermined:
#ifdef __IPHONE_12_0
case UNAuthorizationStatusProvisional:
#endif
return resolve(RNPermissionStatusNotDetermined, result);
case UNAuthorizationStatusDenied:
return resolve(RNPermissionStatusDenied, result);
case UNAuthorizationStatusAuthorized:
#ifdef __IPHONE_14_0
case UNAuthorizationStatusEphemeral: // TODO: Handle Ephemeral status
#endif
#ifdef __IPHONE_12_0
case UNAuthorizationStatusProvisional: // TODO: Handle Provisional status
#endif
return resolve(RNPermissionStatusAuthorized, result);
}
}];
Expand Down
3 changes: 3 additions & 0 deletions ios/PhotoLibrary/RNPermissionHandlerPhotoLibrary.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ - (void)checkWithResolver:(void (^ _Nonnull)(RNPermissionStatus))resolve
case PHAuthorizationStatusDenied:
return resolve(RNPermissionStatusDenied);
case PHAuthorizationStatusAuthorized:
#ifdef __IPHONE_14_0
case PHAuthorizationStatusLimited: // TODO: Handle Limited status
#endif
return resolve(RNPermissionStatusAuthorized);
}
}
Expand Down

0 comments on commit ff4b399

Please sign in to comment.