0

I am getting an error when I try to send messages via the Firebase Notification screen in the console. It says I have an invalid token format, but I have used previously used tokens collected with the same method successfully.

I was not getting this error a few days ago, and notifications were working properly. I just pushed an update to the Google Play Store recently, but this update did not touch any code relating to the notifications.

status.firebase.google.com says that notifications are currently up. All other Firebase usages in my app (database, storage, auth) are working properly.

When I updated my app, I did not change my google-services.json file at all. Do I need to do some sort of update to this file, or some sort of version change on the Firebase Console to keep the versions consistent between the APK and the console?

adjuremods
  • 2,938
  • 2
  • 12
  • 17
aterbo
  • 432
  • 7
  • 24
  • 1
    what is the target you are using in the console? If you are using device token then could you confirm that the token has not changed as a result of the update? – Arthur Thompson Oct 20 '16 at 03:17

1 Answers1

0

As mentioned by @Arthur Thomson (in the comments), your registration token may change as a result of an update in the application. It does matter that you did not change the google-services.json if the user reinstalled or updated the application the token maybe changed.

According to the docummentation about the device registration token, the registration toke may change when:

  • The app deletes Instance ID
  • The app is restored on a new device
  • The user uninstalls/reinstall the app
  • The user clears app data.

So you would need to retrieve the new registration token using the onTokenRefresh() method in your Android client application. I mean, you just need to implement a code to retrieve the new token if it changes.

Hope this helps

GeorgeLBA
  • 334
  • 1
  • 3