android - FirebaseInstanceIdService on TokenRefresh -


i implemented push notifications on app couple of months ago. problem had change firebase cert on aws , there lot of push notification failures. due rollout update on monday.

i know in following cases:

  • app deletes instance id
  • app restored on new device
  • user uninstalls/reinstall app
  • user clears app data

firebaseinstanceidservice gets fired , in turn ontokenrefresh() gets called. question however, if user receives update application, service fired, update equivalent app restored on new device?

this solve push failures if register token aws on receipt,

any info great

i don't think app update cause firebase create new token. can use code force firebase:

        firebaseinstanceid.getinstance().deleteinstanceid();         firebaseinstanceid.getinstance().gettoken(); 

you can in main activity example, , save boolean in shared preferences once done don't refresh token on each launch.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -