KONtx.remotedevice.publishWidgetMessage

publishes an app message

Synopsis

Boolean publishWidgetMessage(String data, [Array<String> instanceIds])

Parameters

Publishes the given JSON-encoded string message data to the identified listeners. No other devices receive the message. If the optional parameter instanceIds is specified, the message should only be sent to the remote devices identified. This parameter can be a String for a single instanceId, an Array<String> of instanceIds or null. If null, the message is sent to all connected remote devices that are subscribed to the app.

Returns

Returns true if sending the message is successful. Returns false otherwise.

Description

Helper method to publish an app message. Publish the given string message data to all listeners. If the optional parameter instanceIds is specified, the message is only sent to the devices with the identified instance IDs. When the device sends a message to the app, the app gets notification via the onWidgetMessageReceived callback event.

Example

Table of Contents