Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Topic subscription in Gcm #183

Closed
sunojvijayan opened this issue Nov 22, 2015 · 4 comments
Closed

Topic subscription in Gcm #183

sunojvijayan opened this issue Nov 22, 2015 · 4 comments

Comments

@sunojvijayan
Copy link

Will it be possible to subscribe to topics and send topic based push using this plugin. I was wondering that in that case we could avoid sending registration ids along with push and send push on a topic and let Gcm do all the id handling. Is this possible?

@eladnava
Copy link
Collaborator

@sunojvijayan You can send push notifications to devices that subscribed to a topic with node-gcm.

However, subscribing to topics needs to happen on the device, not on the server.

The following code sends a message to all devices that subscribed to a topic:

// Send to a topic, with no retry this time
sender.sendNoRetry(message, { topic: '/topics/global' }, function (err, response) {
    if(err) console.error(err);
    else    console.log(response);
});

@sunojvijayan
Copy link
Author

Thanks eladnava. Thanks a lot for your help. I am using phonegap-plugin-push on the client side. Not sure if it supports registering to topics. Can anyone suggest any good plugin for the client side that supports multiple topic registration. Thanks in advance.

@eladnava
Copy link
Collaborator

@sunojvijayan It isn't supported yet, according to this issue:
phonegap/phonegap-plugin-push#79

Hello,
It seems that subscribing to topics is not implemented.

You may be able to find another client library for phonegap, however, I am not aware of one.

@hypesystem
Copy link
Collaborator

I think this issue is resolved :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants