Add possibility to provide a locale when registering push token, make sure to not miss the last notification interaction and get expo push token if has permissions on boot#808
Conversation
If not tap might be missed
|
|
@sync is attempting to deploy a commit to the Knock Team on Vercel. A member of the Team first needs to authorize it. |
packages/expo/src/modules/push/KnockExpoPushNotificationProvider.tsx
Outdated
Show resolved
Hide resolved
| }; | ||
|
|
||
| fetchExpoTokenIfNeeded(); | ||
| }, []); |
There was a problem hiding this comment.
address issue when you want to manually call registerPushTokenToChannel and your user already has granted those permissions, if not the expoPushToken from the provider will be undefined till you call registerForPushNotifications
| "interacted", | ||
| ); | ||
| notificationTappedHandler(response); | ||
| } |
There was a problem hiding this comment.
It's how expo recommend handling the initial push notifications: https://docs.expo.dev/versions/latest/sdk/notifications/#handle-push-notifications-with-navigation
| registerPushTokenToChannel( | ||
| token: string, | ||
| channelId: string, | ||
| locale?: string, |
There was a problem hiding this comment.
the locale in our app can be overridden (not system wide) and at the moment there is no way to tell knock about the custom user's locale
There was a problem hiding this comment.
let me know if you want me to split this pr into multiple
| "expo": "~53.0.22", | ||
| "expo-constants": "~17.1.7", | ||
| "expo-device": "^7.1.4", | ||
| "expo-network": "^8.0.0", |
Description
We have started relying on knock and are faced with some "issues" with the current sdk, wondering if you would be interested in applying some of those fixes?
Checklist