react-native-firestack
react-native-firestack copied to clipboard
Notifications
When I register my device for notifications via:
firestack.cloudMessaging.getToken().then(function (token) {
console.log('device token', token)
})
firestack.cloudMessaging.listenForTokenRefresh(function (token) {
console.log('refresh device token', token)
})
firestack.cloudMessaging.subscribeToTopic().then(function (topic) {
console.log('Subscribe: '+topic)
}).catch(function(err){
console.error(err)
})
firestack.cloudMessaging.listenForReceiveNotification((msg) =>{
console.log('Receive Messages:'+msg.data);
console.log('Receive Messages:'+msg.notification);
})
I get not errors. But when I send a notification via Firebase to my device with its token I don't get a response
You need to pass topic_name in subscribeToTopic function