Module: applications

Methods


<inner> bootstrap(pushApp)

A Convenience function to create a complete Push Application with a set of variants
Parameters:
Name Type Description
pushApp object The push application object
Properties
Name Type Argument Description
pushApplicationName string The name of the Push Application
androidVariantName string <optional>
Android Variant Name
androidGoogleKey string <optional>
The Google Cloud Messaging Key. Required For Android
androidProjectNumber string <optional>
The Google Project Number
iosVariantName string <optional>
iOS Variant Name
iosProduction string <optional>
defaults to false - flag to indicate if a connection to Apples production or sandbox APNS server
iosPassphrase string <optional>
The APNs passphrase that is needed to establish a connection to any of Apple's APNs Push Servers.
iosCertificate string | Buffer | Stream <optional>
the full location of the APNs certificate that is needed to establish a connection to any of Apple's APNs Push Servers.
windowsType string <optional>
mpns or wns
windowsVariantName string <optional>
Windows Variant Name
windowsSid string <optional>
*for wns only* - (Package security identifier) used to connect to the windows push notification services
windowsClientSecret string <optional>
*for wns only* - The client secret (password) to connect to the windows push notification services
simplePushVariantName string <optional>
SimplePush Variant Name
admVariantName string <optional>
Amazon Variant Name
admClientId string <optional>
The client id to connect to the Amazon Device Messaging services
admClientSecret string <optional>
The client secret (password) to connect to the Amazon Device Messaging services
Returns:
A promise that resolves with the update Push Application
Type
Promise
Example
adminClient(baseUrl, settings)
    .then((client) => {
      client.applications.boostrap(pushApp)
        .then((pushApplicaiton) => {
          console.log(pushApplication); // {...}
      });
    });

<inner> create(pushApp)

A function to create a new Push Application
Parameters:
Name Type Description
pushApp object The JSON representation of the push application to create. pushApp.name is required
Returns:
A promise that resolves with the JSON representation of the created push application.
Type
Promise
Example
adminClient(baseUrl, settings)
    .then((client) => {
      client.applications.create(pushApplication)
        .then((newPushApp) => {
          console.log(newPushApp); //{...}
      });
    });

<inner> find(pushAppId)

A function to get all the push applications or just 1 push application
Parameters:
Name Type Argument Description
pushAppId string <optional>
The id of the push application
Returns:
A promise that will resolve with the Array of application objects or if a pushAppId is specified, just the application object
Type
Promise
Example
adminClient(baseUrl, settings)
    .then((client) => {
      client.applications.find()
        .then((applications) => {
        console.log(applications) // [{...},{...}, ...]
      });
    });

<inner> remove(pushAppId)

A function to delete a Push Application
Parameters:
Name Type Description
pushAppId string The id of the push application to delete
Returns:
A promise that resolves with No Content.
Type
Promise
Example
adminClient(baseUrl, settings)
    .then((client) => {
      client.applications.remove(pushApplicationId)
        .then(() => {
          console.log('success');
      });
    });

<inner> reset(pushAppId)

A function to reset an existing Push Application's Master Secret
Parameters:
Name Type Description
pushAppId string The push application id
Returns:
A promise that resolves with the update Push Application
Type
Promise
Example
adminClient(baseUrl, settings)
    .then((client) => {
      client.applications.reset(pushApplicationId)
        .then((pushApplicaiton) => {
          console.log(pushApplication); // {...}
      });
    });

<inner> update(pushApp)

A function to update an existing Push Application
Parameters:
Name Type Description
pushApp object The JSON representation of the push application to update. pushApp.pushApplicationID and pushApp.name is required. ATM, it looks like the only fields that are updatable are name and description
Returns:
A promise that resolves with No Content
Type
Promise
Example
adminClient(baseUrl, settings)
    .then((client) => {
      client.applications.update(pushApplication)
        .then(() => {
          console.log('success');
      });
    });