Installation Model connects a mobile application to a device, the user and other information for the server side to locate devices using application id/version, user id, device type, and subscriptions. Users may have many devices, or Installations, which can receive Notifications from the Application.
Name | Type | Description |
---|---|---|
appId |
String
|
The unique identifier for the application this {{Installation}} is registered for. |
appVersion |
String
|
Version of the application currently running on the client (optional). |
badge |
Number
|
The number of the last displayed badge icon (iOS only). |
created |
Date
|
The date the Installation was created. |
deviceToken |
String
|
The device token as provided by GCM or APN. |
deviceType |
String
|
The device type such as |
modified |
Date
|
The date the Installation was last updated. |
status |
String
|
Status of the installation, provider dependent, like 'Active'. |
subscriptions |
Array
|
The type of notifications the device is subscribed to. |
timeZone |
String
|
The Time Zone ID of the device, ex: America/Vancouver. |
userId |
String
|
The user id that reported by the device. |
Find installations by application id/version
Name | Type | Description |
---|---|---|
deviceType |
String
|
The type of device (android, ios) |
appId |
String
|
The application id |
[appVersion] |
String
|
The application version |
cb |
function(Error|undefined, Array.<Installation>)
|
Callback function passed to find() with |
Find installations by subscriptions
Name | Type | Description |
---|---|---|
deviceType |
String
|
The type of device (android, ios) |
subscriptions |
String or Array.<String>
|
Either a comma/space delimited string or array of subscriptions |
cb |
function(Error|undefined, Array.<Installation>)
|
Callback function passed to find() with |
Find installations by user id
Name | Type | Description |
---|---|---|
deviceType |
String
|
The type of device (android, ios) |
userId |
String
|
The user id |
cb |
function(Error|undefined, Array.<Installation>)
|
Callback function passed to find() with |
Notification Model
See the official documentation for more details on provider-specific properties.
Name | Type | Description |
---|---|---|
alert |
Any
|
The notification's message (iOS only - use |
badge |
Number
|
The value indicated in the top right corner of the app icon. |
category |
String
|
The category for the push notification action (iOS8+ only). |
collapseKey |
String
|
An arbitrary string (such as "Updates Available") used to collapse a group of like messages when the device is offline, so only the last message gets sent to the client (Android only). |
created |
Date
|
The date that the notification is created. |
delayWhileIdle |
Boolean
|
If the device is idle, do not send the message immediately. The server will wait for the device to become active, and then only the last message for
each |
deviceToken |
String
|
The device token as provided by GCM or APN. |
deviceType |
String
|
The device type such as |
expirationInterval |
Number
|
The expiration interval in seconds. The interval starts at the time when the notification is sent to the push notification provider. |
expirationTime |
Date
|
The time that the notification expires. |
message |
String
|
The notification's message (Android only - use |
modified |
Date
|
The date that the notifcation is modified. |
scheduledTime |
Date
|
The time that the notification should be sent (not supported yet). |
sound |
String
|
The name of a sound file in the application bundle (iOS only). |
status |
String
|
Status of the notification (not supported yet). |
The PushManager class. See the options for more information on the settings parameters.
Name | Type | Description |
---|---|---|
settings |
Object
|
The push settings. |
Name | Type | Description |
---|---|---|
ttlInSeconds |
Number
|
Time-to-live, in seconds. |
checkPeriodInSeconds |
Number
|
A number in seconds for the automatic delete check interval |
Lookup or set up push notification service for the given appId
Name | Type | Description |
---|---|---|
appId |
String
|
The application id |
deviceType |
String
|
The type of device (android, ios) |
cb |
function(Error|undefined, Application)
|
Callback function called with |
Configure push notification for a given device type. Return null when no provider is registered for the device type.
Name | Type | Description |
---|---|---|
deviceType |
String
|
The type of device (android, ios) |
pushSettings |
Object
|
The push settings |
Name | Type | Description |
---|---|---|
result |
Provider
|
A provider from PushManager.providers (GcmProvider, ApnsProvider) matching the deviceType (android, ios) |
Push a notification to the given installation. This is a low-level function
used by the other higher-level APIs like notifyById
and notifyByQuery
.
Name | Type | Description |
---|---|---|
installation |
Installation
|
Installation instance - the recipient. |
notification |
Notification
|
The notification to send. |
cb |
function(Error|undefined)
|
Push a notification to the device with the given registration id.
Name | Type | Description |
---|---|---|
installationId |
Object
|
Registration id created by call to Installation.create(). |
notification |
Notification
|
The notification to send. |
cb |
function(Error|undefined)
|
Push a notification to all installations matching the given query.
Name | Type | Description |
---|---|---|
installationQuery |
Object
|
Installation query, e.g. |
notification |
Notification
|
The notification to send. |
cb |
function(Error|undefined)
|
Push notification to installations for given devices tokens, device type and app.
Name | Type | Description |
---|---|---|
appId |
String
|
application id |
deviceType |
String
|
type of device (android, ios) |
deviceTokens |
Array.<String>
|
device tokens of recipients. |
notification |
Notification
|
The Notification object to send. |
cb |
function(Error|undefined)
|