Class: PushMessage

util.PushMessage(devicesopt, messageopt, subjectopt, optionsopt, badgeopt, dataopt)

PushMessages are used to send a push notification to a set of devices

Constructor

new PushMessage(devicesopt, messageopt, subjectopt, optionsopt, badgeopt, dataopt)

Push message will be used to send a push notification to a set of devices

Parameters:
Name Type Attributes Description
devices Iterable.<binding.Entity> <optional>

The Set of device references which
will receive this push notification.

message string <optional>

The message of the push notification.

subject string <optional>

The subject of the push notification.

options string | object <optional>

The options object which can contain additional information and data

Properties
Name Type Attributes Description
icon string <optional>

The icon of the push message

badge string | number <optional>

The badge for iOS or Web Push devices

nativeBadge number <optional>

The number for iOS and Android devices which will occur on the top right of
the icon

webBadge string <optional>

The web badge is the small monochrome icon which will occur on small devices
(web push only)

image string <optional>

An image of the push message (web push only)

actions Object <optional>

Actions that the user can invoke and interact with (web push only)

dir string <optional>

Defines which direction the text should be displayed (web push only)

sound string <optional>

The sound of an incoming push message (web push only)

tag string <optional>

The tag of the push message where messages are going to be collected (web push only)

vibrate Array.<number> <optional>

The vibrate property specifies a vibration pattern for the device's
vibration

renotify boolean <optional>

The renotify option makes new notifications vibrate and play a sound
(web push only)

requireInteraction boolean <optional>

The requireInteraction option lets stay the push message until the
user interacts with it (web push only)

silent boolean <optional>

The silent option shows a new notification but prevents default behavior
(web push only)

data * <optional>

The data object which can contain additional information.

badge string | number <optional>

The badge for iOS or Web Push devices

data * <optional>

The data object which can contain additional information.

Source:

Members

(readonly) devices :Set.<model.Device>

Set of devices

Type:
  • Set.<model.Device>
Source:

(readonly) message :string

Push notification message

Type:
  • string
Source:

(readonly) subject :string

Push notification subject

Type:
  • string
Source:

Methods

addDevice(device) → {void}

Adds a new object to the set of devices

Parameters:
Name Type Description
device binding.Entity

will be added to the device set to receive the push notification

Source:
Returns:
Type
void

toJSON() → {json}

Converts the push message to JSON

Source:
Returns:
Type
json