google cloud messaging - How to get registered into GCM topics from javascript (for Chrome) -


here nice documentation on how implement google cloud messaging (gcm) in chrome. not found reference here or anywhere how subscribe topic using javascript (for chrome).

here have found reference how task android: https://developers.google.com/cloud-messaging/topic-messaging#subscribe-to-a-topic

java code(android) subscribe topic in gcm:

private void subscribetopics(string token) throws ioexception {     gcmpubsub pubsub = gcmpubsub.getinstance(this);     (string topic : topics) {         pubsub.subscribe(token, "/topics/" + topic, null);     } } 

what not looking for

i not looking ways chrome app/extension.

what want

i want send push notification users. far know can achievable in 2 ways:

  1. push message topic
  2. or have to: "you need send list of reg id of devices , list should not exceed 1000 limitation of gcm if want send message more 1000 devices need break list in chunks of 1000."

i want avoid point number 2.

my question

so, question is there way subscribe topic gcm using javascript chrome browser (for web pages)? if there, how that?

gcm topics not supported web push. reason related upcoming addition of payloads required encrypted different key per user.

so i'm afraid stuck 2). of course depends on how many users have keep in mind current state of affairs instantly sending message millions of people if using topics. upon receiving message users "https-ing" site fetch information needed display notification run risk of dosing if topic used lot's of people. batching in groups of 1000 helps throttling incoming traffic.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -