Hardik Bambhania
Hardik Bambhania

Reputation: 1792

Token update in FCM

I am using FCM in my project and my application is register with two FCM project (two sender ID).

Now i want to handle token refresh.And as per document i will get below call back

@Override
public void onNewToken(String token) {
   Log.d(TAG, "Refreshed token: " + token);
}

but have may i know which token is updated ? token updated for sender_id_1 or token updated for sender_id_2 ?

Question 2 : If i receive onNewToken call back with newToken value and if i do not pass that value to server and server try to send push on older token, then what will happen ? what error i will received from FCM ?

Thanks

Upvotes: 1

Views: 256

Answers (1)

AL.
AL.

Reputation: 37778

  1. Looking at the docs for onNewToken() (emphasis mine):

Called when a new token for the default Firebase project is generated.

This is invoked after app install when a token is first generated, and again if the token changes.

Default project points to the first project.

  1. Sending to an expired token would result to a NotRegistered error

Upvotes: 1

Related Questions