tiagomtotti / firebaseNet

Client library for Firebase Cloud Messaging (FCM) written in C# / .NET
Apache License 2.0
95 stars 30 forks source link

InvalidRegistration error #2

Closed flaviusdemian closed 7 years ago

flaviusdemian commented 8 years ago

Hello,

I get this error. InvalidRegistration.

Here is the response.

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

Do you have any suggestions?

Thank you,

tiagomtotti commented 8 years ago

Hi, can you please post the code snippet you're using to send the message, along with the message object? Thanks

flaviusdemian commented 8 years ago

It seems that when I migrated to FCM the server key changed. Now I also get not authorized. Can you please confirm that the server key is the Web Api key?

projectsettings

tiagomtotti commented 8 years ago

On FCM,, you should go to Project Settings -> Cloud Messaging. There you'll find the FCM Token and Server Key. When I wrote the library a couple of months ago, the Token option wasn't avilable. I'll update the code to support it till tomorrow. For now, you should use the Server Key to create the FCM Client.

flaviusdemian commented 8 years ago

Ok, Looking forward, Thanks

flaviusdemian commented 8 years ago

Do you have any suggested documentation in the meanwhile? We are stuck with this and it is bad. Thanks

tiagomtotti commented 8 years ago

Take a look at the integration tests in the project. You should find some samples there.

Em 13 de nov de 2016 13:28, "Flavius Demian" notifications@github.com escreveu:

Do you have any suggested documentation in the meanwhile? We are stuck with this and it is bad. Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tiagomtotti/firebaseNet/issues/2#issuecomment-260192791, or mute the thread https://github.com/notifications/unsubscribe-auth/AMJFQZ0us89nk8odRV9YCRnkAtVpmNmFks5q9yyqgaJpZM4KwsHb .

flaviusdemian commented 8 years ago

Ok. I will

tiagomtotti commented 8 years ago

@slown1 , the invalid registration means that the device you're specifiying in the "To" section wasn't registered to receive notifications from your project.

You should use the client apis https://firebase.google.com/docs/cloud-messaging/ for Android, IoS, to register the device in your project.

If you want to do a test, you can change the To parameter to "/topics/android". This is a pre-built topic in FCM that will send a message to all android devices,