Google Cloud Messaging for Chrome channelId unique per device?

501 views Asked by At

Suppose I have my extension installed on two computers, and I am logged into both with the same google account.

Will chrome.pushMessaging.getChannelId return the same value for both computers? Is there any way to request that each individual install gets its own channel? I cannot find this information readily available anywhere.

The question was asked here on Stack Overflow https://stackoverflow.com/questions/13235810/google-cloud-messaging-and-identity, but there is no answer given.

From what I observe, the Channel ID is unique to the user's account, not unique to the install. But I am not sure if this is intended behavior or I can count on this always being the case.

1

There are 1 answers

0
Marc Rochkind On

I really think the Channel ID is per application ID and will stay that way. Otherwise, think how complex it would be to send a message to, say, 100,000 installations of your app. You'd have to keep a file of 100,000 Channel IDs, and it would take a very long time to invoke the API 100,000 times, since the Channel ID is part of the API call to send a message.

Sorry... I was wrong. To quote https://developer.chrome.com/apps/cloudMessaging:

"The push messaging service returns a channel ID to the client; this ID is specifically linked to your app ID and to the user."

If a server needs to send messages to all the installations of an app, it needs to keep track of the channel IDs sent to the server by those applications, and send the message to those channel IDs.