1

I am creating nativescript angular app with push notifications. I cannot find information what heppens with push token when:

  1. App is restariting in dev mode i see that token is same - is it similar scenario when user closes and opens installed prod app on their phone?
  2. What happens with token when user uninstalls an app - is that token gone?
  3. What happens when user installs an app again - does he gets new push token or token is stored in the phone and is assigned to this device +app forever?

Reason why i am asking is because i do not know when to put token to DB and when to update and should i update at all.

Thanks

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • `firebase.getCurrentPushToken()` always gives you the latest / current token. You may implement your own messaging service and override onNewToken callback to get notified whenever the token is changing or simply store token in app settings, get current token and compare upon app launch, hit server if they are different. – Manoj Apr 26 '20 at 20:53
  • I store users token in DB so i do not want to check token on each app start unless there is no other way. – Vytautas Pranskunas Apr 27 '20 at 07:40
  • I'm not sure you understood, you could store the token locally and compare before hitting server or the perfect solution would be implementing onNewToken callback. – Manoj Apr 27 '20 at 07:41
  • i see. I will try to do what you suggest, just will have to do that on login then – Vytautas Pranskunas Apr 27 '20 at 16:06

0 Answers0