Skip to content

Instantly share code, notes, and snippets.

@danmaas
Created December 23, 2020 00:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danmaas/32cfa51b1b4456e98766bc5b30a6be6f to your computer and use it in GitHub Desktop.
Save danmaas/32cfa51b1b4456e98766bc5b30a6be6f to your computer and use it in GitHub Desktop.
Expo-notifications hack patch to fix iOS provisional permissions
diff --git a/node_modules/expo-notifications/ios/EXNotifications/Permissions/EXNotificationPermissionsModule.m b/node_modules/expo-notifications/ios/EXNotifications/Permissions/EXNotificationPermissionsModule.m
index 4b5fcb6..af045f3 100644
--- a/node_modules/expo-notifications/ios/EXNotifications/Permissions/EXNotificationPermissionsModule.m
+++ b/node_modules/expo-notifications/ios/EXNotifications/Permissions/EXNotificationPermissionsModule.m
@@ -45,10 +45,15 @@ - (instancetype)init
requester:(UMPromiseResolveBlock)resolve
rejecter:(UMPromiseRejectBlock)reject)
{
+ // DJM - revert part of this commit: https://github.com/expo/expo/commit/4500a7536a9d21ce4b1c895d6a11b960be10a82a
+ // which drops the requestedPermission parameter: https://github.com/expo/expo/issues/11414
+ [_requester requestPermissions:requestedPermissions withResolver:resolve rejecter:reject];
+ /*
[UMPermissionsMethodsDelegate askForPermissionWithPermissionsManager:_permissionsManager
withRequester:[EXUserFacingNotificationsPermissionsRequester class]
resolve:resolve
reject:reject];
+ */
}
# pragma mark - UMModuleRegistryConsumer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment