1

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

Hardik Bambhania
  • 1,732
  • 15
  • 25

1 Answers1

1
  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
Community
  • 1
  • 1
AL.
  • 36,815
  • 10
  • 142
  • 281
  • Thank you for answer, I am also thing the same.That i will not get token update for both the sender, i will get for default project only.This is big gap in FCM design from firebase right ? – Hardik Bambhania Aug 29 '18 at 09:56