Class: MASConnectaPluginMessage

MASConnectaPluginMessage

A Utility class that helps in creating and managing a MQTT Message. Specific to Cordova-iOS only.
MASConnectaPluginMessage Construtor
var MASConnectaMessage = new MASConnectaPlugin.MASConnectaMessage();

Members

contentEncoding :string

The content encoding of the payload
Type:
  • string
Source:

contentType :string

The content type of the payload
Type:
  • string
Source:

payload :Array.<byte>

The payload in binary format
Type:
  • Array.<byte>
Source:

receiverObjectId :string

The object identifier of the message receiver
Type:
  • string
Source:

senderDisplayName :string

The DisplayName (field in the /UserInfo mapping in the Gateway) of the message sender
Type:
  • string
Source:

senderObjectId :string

The object identifier of the message sender
Type:
  • string
Source:

senderType :string

The MASPluginSenderType that represents the sender
Type:
  • string
Source:

sentTime :integer

The timestamp in UTC format when the message was sent
Type:
  • integer
Source:

topic :string

The topic of the message
Type:
  • string
Source:

version :string

The version of the message format
Type:
  • string
Source:

Methods

initializeWithPayloadData(successHandler, errorHandler, payload, contentType)

Initialize a message with a payload
Parameters:
Name Type Description
successHandler successCallbackFunction user defined success callback that is invoked on success scenario.
errorHandler errorCallbackFunction user defined error callback that is invoked on failure scenario.
payload Array.<byte> payload as binary
contentType string The content type of the message
Source:

initializeWithPayloadImage(successHandler, errorHandler, payload, contentType)

Initialize a message with a payload
Parameters:
Name Type Description
successHandler successCallbackFunction user defined success callback that is invoked on success scenario.
errorHandler errorCallbackFunction user defined error callback that is invoked on failure scenario.
payload string payload of an image as a Base64 String.
contentType string The content type of the message
Source:

initializeWithPayloadString(successHandler, errorHandler, payload, contentType)

Initialize a message with a payload
Parameters:
Name Type Description
successHandler successCallbackFunction user defined success callback that is invoked on success scenario.
errorHandler errorCallbackFunction user defined error callback that is invoked on failure scenario.
payload string payload as a string
contentType string The content type of the message
Source:

payloadTypeAsImage(successHandler, errorHandler)

The payload property in an image src format
Parameters:
Name Type Description
successHandler successCallbackFunction user defined success callback that is invoked on success scenario.
errorHandler errorCallbackFunction user defined error callback that is invoked on failure scenario.
Source:
Returns:
base64 string

payloadTypeAsString(successHandler, errorHandler)

The payload property in a string format
Parameters:
Name Type Description
successHandler successCallbackFunction user defined success callback that is invoked on success scenario.
errorHandler errorCallbackFunction user defined error callback that is invoked on failure scenario.
Source:
Returns:
String

senderTypeAsString(successHandler, errorHandler)

The senderType property in a string format
Parameters:
Name Type Description
successHandler successCallbackFunction user defined success callback that is invoked on success scenario.
errorHandler errorCallbackFunction user defined error callback that is invoked on failure scenario.
Source:
Returns:
String

stringFromSenderType(successHandler, errorHandler, masSenderType)

The MASConnectaPluginConstants.MASSenderType in a string format
Parameters:
Name Type Description
successHandler successCallbackFunction user defined success callback that is invoked on success scenario.
errorHandler errorCallbackFunction user defined error callback that is invoked on failure scenario.
masSenderType MASConnectaPluginConstants.MASSenderType specify the MAS sender type
Source:
Returns:
String