We have build an app with the Ionic framework (we're beginners to Ionic etc), and we register the device to our Firebase account so that we can sent push messages.
I've now found a PHP snippet which connects to fcm via cURL. I can set a message and title, perfect.
My problem is that I can't get it to work, it requires something called "registration id's". Everything I find about this makes it seem like this is super easy to find, but I can't.
Where to I find these registration ID's? All I want is to send all registered users a notification.
- I have tried about every code I could find, none work. The most obvious IMO is in the Firebase dashboard->authorisation where I find a list with User Id's (which occur after I've registered my device via the app).
- However, this results in
{"error":"InvalidRegistration"}
. When I remove the 'to' all together, the result it "to" (not as JSON, those two characters only). - When I send messages from the Firebase console get send almost instantly
- I've done
user.getToken()
which results in quite a long string. This doesn't work either - I've got a token provided by the FCMPlugin, but thats still not the right registration id
The code I am using can be found here. I've changed 'registration_ids'-> 'to' and the 'android.googleapis.com' to 'fcm.googleapis.com' , I've read somewhere that is the new version. Other that that, the code is identical.