firebase / firebase/quickstart-js
Migrate from other web push service to FCM web push
- Dominant language
- TypeScript
- Stars
- 5.4k
- Forks
- 3.7k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 6
Description
I previously used web push from a push provider on my website and just changed to FCM web push recently. Everything works fine for new visitors coming to our web site. However, for users who already subscribed to previous web push, the browser still recorded their permission status as "Granted". We cannot show permission prompt to ask these users to resubscribe and generate new browser tokens so that we can start sending them push notifications from Firebase.
I've tried the following way:
- Check if client browser has indexeddb with a database name containing "firebase"
- If their permission is granted but no indexeddb then run `messaging.requestPermission()`
But it seems that the requestPermission only shows the prompt when permission status is "default".
I would like to ask if there is any best practices for this type of migration. Any method to assign new browser tokens for old users (subscribed to old push service) when they revisit my website? Thank you.
Contributor guide
Assessment
This issue has not been assessed yet.