This plugin allows apps to receive push messages.
- Supported on iOS.
- Deprecated on Android (use
chrome.gcm
instead)
The API reference is here.
- chrome.pushMessaging.getChannelId returns an object containing a
channelId
, aregistrationId
and adeviceToken
. ThechannelId
is used for sending push messagings to instances of the app running on desktop; theregistrationId
is used for sending push messages to instances of the app running on Android; the deviceToken is used to send messages to instances of the app on iOS devices. - On Android, chrome.identity must be modified so that
getAuthToken
uses the javascript flow (getAuthTokenJS) instead of the native exec flow. OtherwisegetChannelId
will fail to obtain achannelId
(but will still obtain aregistrationId
). - On iOS the token is not application specific, but the messaging system requires a certificate that identifies the application.
- You must install an appropriate auth2 section in your
manifest.json
with suitableclient_id
andscopes
. Push Messaging requires the scopes: https://www.googleapis.com/auth/gcm_for_chrome and https://www.googleapis.com/auth/gcm_for_chrome.readonly
- Renamed plugin to pubilsh to NPM
- Refactor chrome.pushMessaging to work under CSP - Use message queue for native -> JS events
- Fix race conditions causing onLaunched not to fire