I mean in this section of the doc there’s an example of a POST call ( using fetch API ) to the FCM in order to let him trigger a push notification ( If I get it well )
In this post call there’s the
to: '<NATIVE-DEVICE-PUSH-TOKEN>', field which I assume is the result of
getDevicePushTokenAsync BUT there’s also in the data object the
To clarify ( 'cause I know I’m not very clear haha ).
I would like to get some notifications on my app only triggering some POST call to my FCM is this even the right way to do so ?
I don’t want to / can’t really use Expo’s notifications server has I’m working for a client which is in charge of the back end part and won’t use expo.
It’s not very clear which are the steps to get thoses notifications working.
I’ve succeed to get notification from the expo notification tools ( using the register function from the setup docs )
But, I’ve then download google-service.json, linked it in my app.json and changed the register function with
getDevicePushTokenAsync but I can’t receive any notification.
Maybe It’s a send problem… I’ve try through the firebase console with no luck :
I also tried to send that POST request which I was talking about previously with postman and getting a MismatchSenderId error
Do you have some clues for me ?
While testing again in order to make the screens for you it seems that it just WORKED ! ( Through the firebase console )
There’s maybe some kind of delay after creating a firebase project …
So my concern is just that MismatchSenderId error …
I understand that it needs to be in a standalone app in order to try it …
But why I’ve got this missmatch error ? What does not match ? I found my “senderId” in my firebase console… But what should I do with it ? As far as I understand the firebase docs the DevicePushToken is somehow linked to the senderId ?
So I’ve got it working … Some notes :
The DevicePushToken is different when got from the metro bundler and got from a
.apk build ! This explain the MismatchSenderId error…
So my last question is : Why I still need that
data.experienceId in my post request to
https://fcm.googleapis.com/fcm/send it already have the device token no ? Indeed If I delete this field the notification doesn’t trigger…