FirebaseInstanceIdService.class clearly states that onTokenRefresh()
will be called when:
- App deletes Instance ID
- App is restored on a new device
- User uninstalls/reinstall the app
- User clears app data
When and under what circumstances will an app deletes an instance ID? Is there a possibility of it happening while an app is still active (ongoing activity or service)?
The app deletes the Instance ID when you call
FirebaseInstanceId.deleteInstanceId()
in app:And yes, you can call this method while your app is active.