react-native-firestack icon indicating copy to clipboard operation
react-native-firestack copied to clipboard

Notifications

Open theobouwman opened this issue 9 years ago • 1 comments

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

theobouwman avatar Dec 21 '16 08:12 theobouwman

You need to pass topic_name in subscribeToTopic function

priyesh9875 avatar Jan 05 '17 18:01 priyesh9875