From ff4b3995a9c90e100018e311be197bcfac7a0d71 Mon Sep 17 00:00:00 2001 From: Mathieu Acthernoene Date: Sat, 26 Sep 2020 19:35:53 +0200 Subject: [PATCH] Add missing case values in permissions check switches (granted for now) --- ios/Notifications/RNPermissionHandlerNotifications.m | 9 ++++++--- ios/PhotoLibrary/RNPermissionHandlerPhotoLibrary.m | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ios/Notifications/RNPermissionHandlerNotifications.m b/ios/Notifications/RNPermissionHandlerNotifications.m index 64c35a3a..248d84cf 100644 --- a/ios/Notifications/RNPermissionHandlerNotifications.m +++ b/ios/Notifications/RNPermissionHandlerNotifications.m @@ -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); } }]; diff --git a/ios/PhotoLibrary/RNPermissionHandlerPhotoLibrary.m b/ios/PhotoLibrary/RNPermissionHandlerPhotoLibrary.m index a931b4d3..d91d7e1a 100644 --- a/ios/PhotoLibrary/RNPermissionHandlerPhotoLibrary.m +++ b/ios/PhotoLibrary/RNPermissionHandlerPhotoLibrary.m @@ -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); } }