1
votes

I'm looking for ways to handle push notifications from PWA and Native apps.

We have both, and now when we send a push, I want that if user has installed both native and pwa on their mobile, to only receive the push from native, so we would avoid spamming the user with dublicate notifications. We are using Firebase for push notifications.

What are the best practices to handle this dublicate notification issue? I couldn't find any related info on the web.

1

1 Answers

0
votes

This can only be achieved if the user is logged in. In this case you can store the user-identity together with the push notification token. Then on the server you can check which user has registered two notification tokens and send your message only to one token. If your app does not provide any user identity, I see no way to achieve it.

But, are you sure this is the desired behavior? Keep in mind that the user can have more than two tokens, for example if he uses your pwa on multiple devices/browsers.