Web Client 8.0.2

SafariMpnBuilder

SafariMpnBuilder

Utility class that provides methods to build or parse the JSON structure used to represent the format of a push notification.
It provides getters and setters for the fields of a push notification, following the format specified by Apple Push Notification Service (APNs). This format is compatible with MpnSubscription#setNotificationFormat.

Constructor

new SafariMpnBuilder(notificationFormatopt)

Creates an object to be used to create a push notification format.
Use setters methods to set the value of push notification fields or use a JSON structure to initialize the fields.

Parameters:
Name Type Attributes Description
notificationFormat <optional>

A JSON structure representing a push notification format.

See:

Methods

build() → {String}

Produces the JSON structure for the push notification format specified by this object.

Returns:

the JSON structure for the push notification format.

Type
String

getAction() → {String}

Gets the value of aps.alert.action field.

Returns:

the value of aps.alert.action field, or null if absent.

Type
String

getBody() → {String}

Gets the value of aps.alert.body field.

Returns:

the value of aps.alert.body field, or null if absent.

Type
String

getTitle() → {String}

Gets the value of aps.alert.title field.

Returns:

the value of aps.alert.title field, or null if absent.

Type
String

getUrlArguments() → {Array.<String>}

Gets the value of aps.url-args field.

Returns:

the value of aps.url-args field, or null if absent.

Type
Array.<String>

setAction(action) → {SafariMpnBuilder}

Sets the aps.alert.action field.

Parameters:
Name Type Description
action String

A string to be used for the aps.alert.action field value, or null to clear it.

Returns:

this MpnBuilder object, for fluent use.

Type
SafariMpnBuilder

setBody(body) → {SafariMpnBuilder}

Sets the aps.alert.body field.

Parameters:
Name Type Description
body String

A string to be used for the aps.alert.body field value, or null to clear it.

Returns:

this MpnBuilder object, for fluent use.

Type
SafariMpnBuilder

setTitle(title) → {SafariMpnBuilder}

Sets the aps.alert.title field.

Parameters:
Name Type Description
title String

A string to be used for the aps.alert.title field value, or null to clear it.

Returns:

this MpnBuilder object, for fluent use.

Type
SafariMpnBuilder

setUrlArguments(urlArguments) → {SafariMpnBuilder}

Sets the aps.url-args field.

Parameters:
Name Type Description
urlArguments Array.<String>

An array to be used for the aps.url-args field value, or null to clear it.

Returns:

this MpnBuilder object, for fluent use.

Type
SafariMpnBuilder