publishThingModelMessage(params: Object)
Requires:
DeviceKit≥2.0.7@ray-js/ray≥0.6.23
Platforms:
iOSAndroid
Description
Send a message via the Thing Model
Parameters
| Property | Type | Required | Description |
|---|---|---|---|
devId | string | Yes | Device ID |
type | number | Yes | Type 0: Property, 1: Action, 2: Event |
| Yes | Thing model delivery payload; the structure varies by type. Examples: Example: type == property: payload = { "color":"green", "brightness": 50 } type == action: payload = { "actionCode": "testAction", "inputParams": { "inputParam1":"value1", "inputParam2":"value2" } } | ||
complete | () => void | No | Completion callback (executed on both success and failure) |
success | () => void | No | Callback on successful API call |
fail | (params: Object) => void | No | Failure callback |
fail callback parameters
| Property | Type | Description |
|---|---|---|
errorMsg | string | Error message |
errorCode | string | number | Error code |
| Error extension |
Return Value
None