Use chrome.gcm to enable apps and extensions to send and receive messages through the Google Cloud Messaging Service.
Use chrome.gcm to enable apps and extensions to send and receive messages through the Google Cloud Messaging Service. * available since Chrome 35 * https://developer.chrome.com/apps/gcm
(get-max-message-size)
The maximum size (in bytes) of all key/value pairs in a message.
https://developer.chrome.com/apps/gcm#property-MAX_MESSAGE_SIZE.
The maximum size (in bytes) of all key/value pairs in a message. https://developer.chrome.com/apps/gcm#property-MAX_MESSAGE_SIZE.
(register sender-ids)
Registers the application with GCM. The registration ID will be returned by the callback. If register is called again with the same list of senderIds, the same registration ID will be returned.
|sender-ids| - A list of server IDs that are allowed to send messages to the application. It should contain at least one and no more than 100 sender IDs.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [registration-id] where:
|registration-id| - A registration ID assigned to the application by the GCM.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Registers the application with GCM. The registration ID will be returned by the callback. If register is called again with the same list of senderIds, the same registration ID will be returned. |sender-ids| - A list of server IDs that are allowed to send messages to the application. It should contain at least one and no more than 100 sender IDs. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [registration-id] where: |registration-id| - A registration ID assigned to the application by the GCM. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/gcm#method-register.
(send message)
Sends a message according to its contents.
|message| - A message to send to the other party via GCM.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [message-id] where:
|message-id| - The ID of the message that the callback was issued for.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Sends a message according to its contents. |message| - A message to send to the other party via GCM. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [message-id] where: |message-id| - The ID of the message that the callback was issued for. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/gcm#method-send.
(tap-all-events chan)
Taps all valid non-deprecated events in chromex.app.gcm namespace.
Taps all valid non-deprecated events in chromex.app.gcm namespace.
(tap-on-message-events channel & args)
Fired when a message is received through GCM.
Events will be put on the |channel| with signature [::on-message [message]] where:
|message| - A message received from another party via GCM.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
Fired when a message is received through GCM. Events will be put on the |channel| with signature [::on-message [message]] where: |message| - A message received from another party via GCM. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/apps/gcm#event-onMessage.
(tap-on-messages-deleted-events channel & args)
Fired when a GCM server had to delete messages sent by an app server to the application. See Messages deleted event section of Cloud Messaging documentation for details on handling this event.
Events will be put on the |channel| with signature [::on-messages-deleted []].
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
https://developer.chrome.com/apps/gcm#event-onMessagesDeleted.
Fired when a GCM server had to delete messages sent by an app server to the application. See Messages deleted event section of Cloud Messaging documentation for details on handling this event. Events will be put on the |channel| with signature [::on-messages-deleted []]. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/apps/gcm#event-onMessagesDeleted.
(tap-on-send-error-events channel & args)
Fired when it was not possible to send a message to the GCM server.
Events will be put on the |channel| with signature [::on-send-error [error]] where:
|error| - An error that occured while trying to send the message either in Chrome or on the GCM server. Application can retry sending the message with a reasonable backoff and possibly longer time-to-live.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
Fired when it was not possible to send a message to the GCM server. Events will be put on the |channel| with signature [::on-send-error [error]] where: |error| - An error that occured while trying to send the message either in Chrome or on the GCM server. Application can retry sending the message with a reasonable backoff and possibly longer time-to-live. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/apps/gcm#event-onSendError.
(unregister)
Unregisters the application from GCM.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
Unregisters the application from GCM. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/apps/gcm#method-unregister.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close