Class Index | File Index

Classes


Class KiiPushInstallation

Represents a KiiPushInstallation object
Defined in: KiiSDK.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
 
getMqttEndpoint(installationID, callbacks)
Get MQTT endpoint.
 
installApns(deviceToken, development, callbacks)
Register the id issued by APNS to the Kii cloud for current logged in user.
 
installGcm(installationRegistrationID, development, callbacks)
Register the id issued by GCM to the Kii cloud for current logged in user.
 
installMqtt(development, callbacks)
Register a MQTT installation to the Kii cloud for current logged in user.
 
uninstall(installationRegistrationID, deviceType, callbacks)
Unregister the push settings by the id(issued by push provider) that is used for installation.
 
uninstallByInstallationID(installationID, callbacks)
Unregister the push settings by the id(issued by KiiCloud) that is used for installation.
Class Detail
KiiPushInstallation()
Method Detail
{Promise} getMqttEndpoint(installationID, callbacks)
Get MQTT endpoint. If the MQTT endpoint is not ready, this method retries request up to three times.

Note that only MQTT over tls is supported currently.
Don't use portSSL, portWS or portWSS until we support it.

					
					
					
						
							
Parameters:
{String} installationID
The ID of the installation in the platform.
{Object} callbacks Optional
An object with callback methods defined
{Method} callbacks.success
The callback method to call on a successful resend request
argument is response object. response.installationID is ID of the installation in the platform.
{Method} callbacks.failure
The callback method to call on a failed resend request
argument is Error object.
Returns:
{Promise} return promise object.
  • fulfill callback function: function(response).
    • response.installationID is ID of the installation in the platform.
    • response.username is username to use for connecting to the MQTT broker.
    • response.password is assword to use for connecting to the MQTT broker.
    • response.mqttTopic is topic to subscribe in the MQTT broker.
    • response.host is hostname of the MQTT broker.
    • response.X-MQTT-TTL is the amount of time in seconds that specifies how long the mqttTopic will be valid, after that the client needs to request new MQTT endpoint info.
    • response.portTCP is port to connect using plain TCP.
    • response.portSSL is port to connect using SSL/TLS.
    • response.portWS is port to connect using plain Websocket.
    • response.portWSS is port to connect using SSL/TLS Websocket.
  • reject callback function: function(error). error is an Error instance.
    • error.message

{Promise} installApns(deviceToken, development, callbacks)
Register the id issued by APNS to the Kii cloud for current logged in user.

					
					
					
						
							
Parameters:
{String} deviceToken
The ID of registration that identifies the installation externally.
{Boolean} development
Indicates if the installation is for development or production environment.
{Object} callbacks Optional
An object with callback methods defined
{Method} callbacks.success
The callback method to call on a successful resend request
argument is response object. response.installationID is ID of the installation in the platform.
{Method} callbacks.failure
The callback method to call on a failed resend request
argument is Error object.
Returns:
{Promise} return promise object.
  • fulfill callback function: function(response).
    • response.installationID is ID of the installation in the platform.
  • reject callback function: function(error). error is an Error instance.
    • error.message

{Promise} installGcm(installationRegistrationID, development, callbacks)
Register the id issued by GCM to the Kii cloud for current logged in user.

					
					
					
						
							
Parameters:
{String} installationRegistrationID
The ID of registration that identifies the installation externally.
{Boolean} development
Indicates if the installation is for development or production environment.
{Object} callbacks Optional
An object with callback methods defined
{Method} callbacks.success
The callback method to call on a successful resend request
argument is response object. response.installationID is ID of the installation in the platform.
{Method} callbacks.failure
The callback method to call on a failed resend request
argument is Error object.
Returns:
{Promise} return promise object.
  • fulfill callback function: function(response).
    • response.installationID is ID of the installation in the platform.
  • reject callback function: function(error). error is an Error instance.
    • error.message

{Promise} installMqtt(development, callbacks)
Register a MQTT installation to the Kii cloud for current logged in user.

					
					
					
						
							
Parameters:
{Boolean} development
Indicates if the installation is for development or production environment.
{Object} callbacks Optional
An object with callback methods defined
{Method} callbacks.success
The callback method to call on a successful resend request
argument is response object. response.installationID is ID of the installation in the platform.
{Method} callbacks.failure
The callback method to call on a failed resend request
argument is Error object.
Returns:
{Promise} return promise object.
  • fulfill callback function: function(response).
    • response.installationID is ID of the installation in the platform.
    • response.installationRegistrationID is ID of registration that identifies the installation externally.
  • reject callback function: function(error). error is an Error instance.
    • error.message

{Promise} uninstall(installationRegistrationID, deviceType, callbacks)
Unregister the push settings by the id(issued by push provider) that is used for installation.

					
					
					
						
							
Parameters:
{String} installationRegistrationID
The ID of registration that identifies the installation externally.
{String} deviceType
The type of the installation. Supported types are "ANDROID", "IOS" and "MQTT".
{Object} callbacks Optional
An object with callback methods defined
{Method} callbacks.success
The callback method to call on a successful resend request
{Method} callbacks.failure
The callback method to call on a failed resend request
argument is Error object.
Returns:
{Promise} return promise object.
  • fulfill callback function: function().
  • reject callback function: function(error). error is an Error instance.
    • error.message

{Promise} uninstallByInstallationID(installationID, callbacks)
Unregister the push settings by the id(issued by KiiCloud) that is used for installation.

					
					
					
						
							
Parameters:
{String} installationID
The ID of the installation issued by KiiCloud.
{Object} callbacks Optional
An object with callback methods defined
{Method} callbacks.success
The callback method to call on a successful resend request
{Method} callbacks.failure
The callback method to call on a failed resend request
argument is Error object.
Returns:
{Promise} return promise object.
  • fulfill callback function: function().
  • reject callback function: function(error). error is an Error instance.
    • error.message

Documentation generated by JsDoc Toolkit 2.4.0 on Mon May 21 2018 05:13:32 GMT-0000 (UTC)