Module: installations

Methods


<inner> find(options)

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

<inner> remove(options)

A function to remove an installation
Parameters:
Name Type Description
options object An options object
Properties
Name Type Description
variantId string The id of the variant
installationId string the id of the installation to remove
Returns:
A promise that will resolve
Type
Promise
Example
adminClient(baseUrl, settings)
    .then((client) => {
      client.installations.remove(options)
        .then(() => {
        console.log('success');
      });
    });

<inner> update(options)

A function to update an existing installation.
Parameters:
Name Type Description
options object An options object that is the JSON representation of the Variant to Update
Properties
Name Type Description
variantId string The id of the push application
installation object the installation object
Properties
Name Type Argument Description
id string The id of the installation to be updated
deviceToken string the deviceToken of the installation
alias string <optional>
string to map the Installation to an actual user.
enabled boolean <optional>
Flag if the actual client installation is enabled (default) or not.
platform string <optional>
the name of the platform. FOR ADMIN UI ONLY - Helps with setting up Routes
deviceType string <optional>
the type of the registered device
operatingSystem string <optional>
the name of the Operating System.
osVersion string <optional>
the version string of the mobile OS.
Returns:
A promise that resolves with No Content
Type
Promise
Example
adminClient(baseUrl, settings)
    .then((client) => {
      client.installations.update(installationOptions)
        .then(() => {
        console.log('success')
      });
    });