The Firebase documentation clearly states that the FirebaseInstanceIdService must be implemented to access the updated token and that manual registration is no longer required, since the library takes care of all the processes.
The problem is that onTokenRefresh is called only once, and if something went wrong while transferring it to my server, the application must wait until the next update or complete a uninstall / reinstall.
Can I apply the same logic as previous GCM implementations? That is, every time I launch my application, I use a token using FirebaseInstanceId.getInstance().getToken() , and send it to my server, not caring if it has already been sent. The same thing is done in onTokenRefresh .
Does this approach have any kind of error?
android token firebase google-cloud-messaging
Alessandro
source share