Reputation: 1792
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
Reputation: 37778
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.
NotRegistered
errorUpvotes: 1