-
<inner> importer(settings, devices)
-
A function for uploading a JSON file to allow massive device registration (aka import)
Parameters:
Name |
Type |
Description |
settings |
object
|
An settings object
Properties
Name |
Type |
Description |
variantId |
string
|
The id of the variant - used for authentication and variant lookup |
secret |
string
|
The variant secret - used for authentication |
|
devices |
Array
|
Stream
|
String
|
This is the list of Devices to upload. |
Returns:
A promise that will resolve
-
Type
-
Promise
Example
registrationClient(baseUrl)
.then((client) => {
client.registry.importer(settings, devices)
.then(() => {
console.log('success');
});
});
-
<inner> registerDevice(settings, deviceOptions)
-
A function to register a device to the UnifiedPush Server
Parameters:
Name |
Type |
Description |
settings |
object
|
An settings object
Properties
Name |
Type |
Description |
variantId |
string
|
The id of the variant - used for authentication and variant lookup |
secret |
string
|
The variant secret - used for authentication
*Device Options**
These are metadata for each Device. The Device Token is the only required thing |
|
deviceOptions |
object
|
a deviceOptions object
Properties
Name |
Type |
Argument |
Description |
deviceToken |
string
|
|
unique string to identify an Installation with its PushNetwork |
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 will resolve with the device options registered
-
Type
-
Promise
Example
registrationClient(baseUrl)
.then((client) => {
client.registry.registerDevice(settings, deviceOptions)
.then((device) => {
console.log(device) // {...}
});
});
-
<inner> unregisterDevice(settings)
-
A function to unregister a device to the UnifiedPush Server
Parameters:
Name |
Type |
Description |
settings |
object
|
An settings object
Properties
Name |
Type |
Description |
variantId |
string
|
The id of the variant - used for authentication and variant lookup |
secret |
string
|
The variant secret - used for authentication |
deviceToken |
string
|
unique string to identify an Installation with its PushNetwork |
|
Returns:
A promise that will resolve
-
Type
-
Promise
Example
registrationClient(baseUrl)
.then((client) => {
client.registry.unregisterDevice(settings)
.then(() => {
console.log('success');
});
});