1

weird question about Firebase ok the scenario

  • I login using firebase to get the token so i can do a good old push notification...then save that token in database (firestore, mongodb, oracle, mysql , etc..)
  • I trigger the event from express server.... then a leave the application close (mobile) for like 24 hour +- .... then when i tried it again without the mobile app open the notification did not work

The question is there is a way i can regenerate the token from the server side without even open the mobile app so it can give the new token?

Azri
  • 85
  • 1
  • 8
  • There is no way for your server-side code to force expiration of an FCM token that I'm aware of. But why do you want to do that? What is the problem with your current code, that you think generating a new token will fix? (also see [XY problem](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem)) – Frank van Puffelen Jan 02 '21 at 15:44
  • Thank for that info about we can't generate new expiration token. Well my app work find just with the current code. But when i leave the app unopen for like 24 hour+- it just say something like token expired/ unregister. So i was hopping to somehow get a new token form server side ps : still new in firebase – Azri Jan 03 '21 at 05:13
  • If you're getting an error, shows us the exact error message and code that allows anyone to reproduce that error. Without those, it'll be hard to help. Also see [how to create a minimal, complete, verifiable example](http://stackoverflow.com/help/mcve). – Frank van Puffelen Jan 03 '21 at 16:29
  • 1
    I found an a year old post and https://stackoverflow.com/questions/54870347/firebase-cloud-messaging-expiration-of-fcm-token and it somehow match my case and it actually like what you say earlier. Their is no way. I guess i have to lunch the app to get new token for that to work – Azri Jan 03 '21 at 16:40
  • 1
    In that case also check: https://stackoverflow.com/questions/65479140/check-if-firebase-registration-token-is-invalid/65480346#65480346 – Frank van Puffelen Jan 03 '21 at 17:20
  • Thanks you. That help a lot. Didn't think of that earlier. Currently just checked every single new and old token for every transaction. – Azri Jan 04 '21 at 01:29

0 Answers0