How to handle the first token in the Firebase token service in Android?

I am making an Android application that uses Firebase Cloud Messaging.

Whenever a new token is generated, the onTokenRefresh () function of the class that extends FirebaseInstanceIdService is called.

However, I noticed that when the token was first created, this function is not called. I want to send the first token to my Server. How to implement this?

+4
source share
1 answer

onTokenRefresh () is just being called when you have an Internet connection, after the token has returned from FCM , you can send it to your server

. fooobar.com/questions/627372/...

+2

All Articles