Is it possible, and is there any documentation to use this library with android and firebase?
Please give a example project.
Yep, does this work on Firebase? I've been trying it out and it doesn't get any notifications, at least on Android, seems like there is a lot missing from the guide at https://firebase.google.com/docs/cloud-messaging/android/client
I was able to receive push notifications using both the FCM web interface and the https://fcm.googleapis.com/fcm/send endpoint. You need to get the token from the device and use that to send a message.
Finally made it work with the REST endpoint, not from the web interface, can you show us what you put in the fields for the message? @nolan-m
POST https://fcm.googleapis.com/fcm/send
{
"notification": {
"title": "This is the title",
"body": "This is the body"
},
"to" : __DEVICE_TOKEN__
}
Yes, that is for the REST endpoint, but it doesn't work from the Firebase web console.
@octohedron, @nolan-m,
When you set up this plugin what you write in manifest.xml to works with firebase ?
@kholiavko-roman
All you need to add is the gcmSenderID
<meta-data android:name="com.wix.reactnativenotifications.gcmSenderId" android:value="1234567890\0"/>
@nolan-m
Thank you! I already added it, but I cant receive device token on setRegistrationTokenUpdateListener, maybe you have an example project and can share it ?
I tried to do next:
NotificationsAndroid.refreshToken();
NotificationsAndroid.setRegistrationTokenUpdateListener(onPushRegistered);
function onPushRegistered(token) {
console.log('token is');
console.log(token);
}
But, I didn't see the token in console, onPUshRegiseteddon't work.
@kholiavko-roman any progress? I have the same issue.
@ronilitman I doesn't found a solution for this navigation. I use instead react-router-flux.
@kholiavko-roman That is about notifications, not navigation, did you mean something else?
@ronilitman sorry, I has early problem with wix react-navigation too, and now I thought about that.
instead of this library i use react-native-fcm.
@kholiavko-roman Thank you, I'll give it a try.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.
The issue has been closed for inactivity.
Most helpful comment
@nolan-m
Thank you! I already added it, but I cant receive device token on
setRegistrationTokenUpdateListener, maybe you have an example project and can share it ?I tried to do next:
But, I didn't see the token in console,
onPUshRegiseteddon't work.