New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[expo-notifications][expo-permissions] Move notification permission requesters to notifications package #8486
Conversation
450e16f
to
4a87bc1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
ios/Exponent/Versioned/Core/UniversalModules/Permissions/EXScopedPermissions.m
Outdated
Show resolved
Hide resolved
4a87bc1
to
902ef3f
Compare
It is replaced by expo-notification's EXUserFacingNotificationsPermissionsRequester, now included in Expo Client
…ssion requester to notifications Fixes https://github.com/unimodules/react-native-unimodules/issues/136. expo-permissions no longer *may* register for push notifications.
…tion permission progress In ExpoKit remote notification requester depended on a notification being emitted by ExpoKit. Now we don't want to depend on ExpoKit, so thanks to unimodules we can just add a singleton module and receive the permission progress ourselves.
… at expo-permissions
…ns requesters are included
902ef3f
to
c46e9a2
Compare
After this update, it seems expo-notifications is conflict with expo-permissions. I got build errors:
Is there a way to resolve this? It seems expo-permissions is not updated for a while and may not reflect this change? |
Good catch! It looks like the appropriate change has been published as part of |
😅 @sjchmiela the npm version is still at 8.1.0: https://www.npmjs.com/package/expo-permissions |
Yeah, we recently revamped our release process, so now during release we first publish packages under new version, but not the
which is expected. Sorry for the confusion1 |
@sjchmiela nice! thanks for the explanation! In this case, I believe it's best if expo-notifications can also follow this rule? so that it won't get messed up with others. |
👍 I totally agree with you, when I was promoting |
You are already doing an awesome job! |
Why
Fixes https://github.com/unimodules/react-native-unimodules/issues/136. This is what we wanted to do anyway—move code responsible for permissions to respective modules.
How
EXUserNotificationPermissionRequester
as it was left only as a fallback for whenexpo-notifications
is not installed. Now that in Expo Clientexpo-notifications
will be installed, this class would never be used.expo-permissions
toexpo-notifications
, effectively removing support for callingaskAsync(Permissions.NOTIFICATIONS)
fromexpo-permission
ifexpo-notifications
is not installedwhile moving I write a way for the requester to receive callbacks about permission being accepted or declined. I used a
UIApplicationDelegate
singleton module to which requesters can register to receive callbacks.since new notification permission requesters now may return
null
inside the permission response I had to either:NSNull
inEXPermissionsManager
(it is returned by the user notifications permissions requester)notifications
anduserFacingNotifications
from being saved to kernel service since we don't scope them even so (thanks @lukmccall for the tip!)We decided to stick to the second idea.
Test Plan