GCM: Message sent on a topic does not reach the browser

530 views Asked by At

My setup include a webapp, a backend server and an android app. I want to be able to chat between my android app and webapp.

Init: Android app has subscribed to the topic /topics/chatGroupName Similarly on browser, I get the registrationToken and send it to my server where I use code similar in https://github.com/ToothlessGear/node-gcm/pull/211/files (addToTopicNoRetry) to subscribe the browser to the topic: /topics/chatGroupName

When I send a message from the web, I use my backend server to send a GCM message on a topic like /topics/chatGroupName and the android app receives this message.

But when I send GCM message from Android app on this topic /topics/chatGroupName, I dont get any notification on the browser app.

Even my https://iid.googleapis.com/iid/info/REGISTRATION_TOKEN?details=true shows that this registration token has already subscribed to /topics/chatGroupName

1

There are 1 answers

0
Vibgy On

Firebase has now released javascript library that supports FCM push notifications with support for topics. Ref: https://firebase.google.com/docs/cloud-messaging/js/client