Here 's some good documentation on how to implement Cloud Messaging Service (GCM) in Chrome. But I did not find a link here or anywhere, how to subscribe to a topic using javascript (for Chrome).
Here I found a link on how to complete the task for Android:
https://developers.google.com/cloud-messaging/topic-messaging#subscribe-to-a-topic
Java code (Android) for subscribing to a topic in GCM:
private void subscribeTopics(String token) throws IOException {
GcmPubSub pubSub = GcmPubSub.getInstance(this);
for (String topic : TOPICS) {
pubSub.subscribe(token, "/topics/" + topic, null);
}
}
WHAT I DO NOT LOOK FOR
I am NOT looking for ways for a Chrome app / extension.
WHAT I WANT
I want to send a push notification to all my users. So far I know that this can be achieved in two ways:
- Click message in topic
- : " reg id , 1000, GCM, 1000 , 1000.
2.
, : GCM Javascript Chrome ( -)? , ?