APNClient

push. APNClient

Send push notification using @parse/node-apn module, initialize Apple Push Notification service in the current process, Apple supports multiple connections to the APN gateway but not too many so this should be called on the dedicated backend hosts, on multi-core servers every spawn web process will initialize a connection to APN gateway.

Constructor

new APNClient(options, key, sandboxopt)

Source:
Parameters:
Name Type Attributes Description
options object
key string

Authentication Token key, file.p8 or base64 key data

options.teamId string

ID of the team associated with the provider token key

options.keyId string

The ID of the key issued by Apple

sandbox boolean <optional>

true if in sandbox mode

Methods

send(device, options, callbackopt)

Description:
  • Send push notification to an Apple device, returns true if the message has been queued.

Source:
Parameters:
Name Type Attributes Description
device object
options object
Properties
Name Type Attributes Description
msg string <optional>

message text

title string <optional>

alert title

badge string <optional>

badge number

sound string <optional>

1, true or a sound file to play

category string <optional>

a user notification category

alertAction string <optional>

action to exec per Apple doc, action

launchImage string <optional>

image to show per Apple doc, launch-image

contentAvailable string <optional>

content indication per Apple doc, content-available

mutableContent string <optional>

mark the notification to go via extention for possible modifications

locKey string <optional>

localization key per Apple doc, loc-key

locArgs string <optional>

localization key per Apple doc, loc-args

titleLocKey string <optional>

localization key per Apple doc, title-loc-key

titleLocArgs string <optional>

localization key per Apple doc, title-loc-args

threadId string <optional>

grouping id, all msgs with the same id will be grouped together

id string <optional>

send id in the user properties

type string <optional>

set type of the event

url string <optional>

launch url

payload string <optional>

an object with additional fileds to send in the message payload

callback function <optional>