queelag / fcm

MIT License
6 stars 2 forks source link

Getting duplicate messages when opening app [Intermittent] #8

Open suyog-bst opened 2 months ago

suyog-bst commented 2 months ago

I noticed this sometimes that if I close the app and restart it, it receives some messages that have already been received previously. The fcm message id is also the same. This happens intermittently.

If it helps, I normally close the app about 10-15 seconds after receiving the FCM message and then restart it.

alchemicas commented 1 month ago

Hi @suyog-bst ! Don't know if you looked at the examples, but you need to provide a Storage instance to the FcmClient in order to have persistence of the ids that have already been read, by default the FcmClient uses the MemoryStorage, which only lasts as long as the application is running.