- Description:
Messaging and push notifications for mobile and other clients, supports Webpush push notifications.
Emits a signal uninstall(client, device_id, user_id) on device invalidation or if a device token is invalid as reported by the server, user_id may not be available.
- Source:
Classes
Methods
(static) configureModule(options)
- Description:
Perform initial setup by calling static configure method for each module
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object | Array.<object> | whole config object for the type |
(static) init(options, callbackopt)
- Description:
Initialize supported notification services, it supports jobs arguments convention so can be used in the jobs that need to send push notifications in the worker process. Can be called muny times, only new modules will be initialized.
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
options |
object | ||
callback |
function |
<optional> |
(static) parseDevice(device)
- Description:
Parse device URN and returns an object with all parts into separate properties. A device URN can be in the following format:
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
device |
string | [type://]token[@app]
|
(static) send(device, options, callback)
Parameters:
| Name | Type | Description | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
device |
string | where to send the message to, can be multiple ids separated by , or |. |
|||||||||||||||||||||||||||||||||
options |
object |
Properties
|
|||||||||||||||||||||||||||||||||
callback |
function |
(static) shutdown(options, callbackopt)
- Description:
Shutdown notification services, may wait till all pending messages are sent before calling the callback
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
options |
object | ||
callback |
function |
<optional> |