skip to Main Content

I have enabled developer mode in flutter app development. I am using Firebase Cloud Messaging to send notifications. everything works fine There is a notification coming to the normal app. But after a while I can no longer send notifications to the app.

{"multicast_id":5417898952266349101,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"InvalidRegistration"}]}

The fcm device token doesn’t seem to work. This caused me to request a new fcm device token. and after using it for a while, it came back like the first time

Is this caused by the APN token being canceled? or caused by enabling developer mode to develop apps.

2

Answers


  1. InvalidRegistration means that your token is expired or invalid. In your case, seems that the token becomes invalid after few times.

    It can happen for many reasons: uninstalling and reinstalling your app, clearing app data, programmatically request a new token to Firebase, conflicting libraries which request new device tokens etc..

    The best thing you can do is to read carefully Best practices for FCM registration token management and to create a reliable system that updates devices’ tokens when needed (also with a server-side logic).

    Login or Signup to reply.
  2. Ensure you have configured your APNs settings in the Firebase console correctly. This involves uploading the APNs authentication key or certificate, and enabling the necessary services.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search