Where to find Reference_Ids for Firebase Cloud Messaging?

前端 未结 2 1063
自闭症患者
自闭症患者 2020-12-21 17:57

After a lot of reading and Googling it seems I have made a complete setup for Google Cloud Messaging to send push-notifications. My missing link is the Reference_Ids

相关标签:
2条回答
  • 2020-12-21 18:22

    You should use Api server_key .

    Go to firebase console -> click on your project -> click on gear icon -> project_setting -> cloud_messaging

    0 讨论(0)
  • 2020-12-21 18:27

    InvalidRegistration means that the registration token (registration id) you used is invalid (doesn't exist, wrong format):

    Check the format of the registration token you pass to the server. Make sure it matches the registration token the client app receives from registering with Firebase Notifications. Do not truncate or add additional characters.

    Make sure that you are using the correct and corresponding registration token to the device you intend to send the message to. For testing, I would suggest to make use of the Firebase Console too, so that you can see if the error still occurs from there.

    For Android, you can retrieve the registration token by calling:

    FirebaseInstanceID.getToken()
    

    You may then choose to store the token to your App Server.

    0 讨论(0)
提交回复
热议问题