路由 router

更新时间:
复制 MD 格式

本文介绍自定义设备面板SDK中路由跳转的API调用。

背景信息

SDK的安装与API调用方法,请参考快速开始

路由打开

open

请求参数

参数

参数类型

子参数

子参数类型

描述

是否必填

schema

string

路由地址

options

object

params

object

打开参数

expectReceiveResult

boolean

是否返回时带参数

出参

参数

参数类型

子参数

子参数类型

描述

result

boolean

-

-

调用结果:true。

调用示例

import { router } from 'aliyun-livinglink-sdk';

router.open('link://router/device_setting',{
   params: {
     iotId:'xxx'
   },
  expectReceiveResult: true,
}).then((res)=>{
   console.log(res)
})

API支持度

云智能

自有品牌

天猫精灵

✔︎

✔︎

✔︎

退出当前容器

exit

请求参数

参数

参数类型

子参数

子参数类型

描述

是否必填

params

object

-

-

参数

出参

参数

参数类型

子参数

子参数类型

描述

result

boolean

-

-

调用结果:true。

调用示例

import { router } from 'aliyun-livinglink-sdk';

router.exit().then((res)=>{
   console.log(res)
})

API支持度

云智能

自有品牌

天猫精灵

✔︎

✔︎

✔︎

跳转到设备设置插件

toDeviceSetting

请求参数

参数

参数类型

子参数

子参数类型

描述

是否必填

deviceIdentity

object

iotId

string

设备ID,生活物联网平台为设备颁发的ID,设备的唯一标识符。

productKey

string

产品的Key,设备证书信息之一。创建产品时,生活物联网平台为该产品颁发的全局唯一标识。

skillId

int

技能ID

天猫精灵App必填

出参

参数

参数类型

子参数

子参数类型

描述

result

boolean

-

-

调用结果:true。

调用示例

import { router } from 'aliyun-livinglink-sdk';

router.toDeviceSetting({
 iotId:'xxx'
}).then((res)=>{
   console.log(res)
})

API支持度

云智能

自有品牌

天猫精灵

✔︎

✔︎

✔︎

跳转到云端定时插件

toCloudTimer

请求参数

参数

参数类型

子参数

子参数类型

描述

是否必填

deviceIdentity

object

iotId

string

设备ID,生活物联网平台为设备颁发的ID,设备的唯一标识符。

productKey

string

产品的Key,设备证书信息之一。创建产品时,生活物联网平台为该产品颁发的全局唯一标识。

skillId

int

技能ID

天猫精灵App必填

出参

参数

参数类型

子参数

子参数类型

描述

result

boolean

-

-

调用结果:true。

调用示例

import { router } from 'aliyun-livinglink-sdk';

router.toCloudTimer({
 iotId:'xxx'
}).then((res)=>{
   console.log(res)
})

API支持度

云智能

自有品牌

天猫精灵

✔︎

✔︎

✔︎

跳转到本地定时插件

toLocalTimer

请求参数

参数

参数类型

子参数

子参数类型

描述

是否必填

deviceIdentity

object

iotId

string

设备ID,生活物联网平台为设备颁发的ID,设备的唯一标识符。

productKey

string

产品的Key,设备证书信息之一。创建产品时,生活物联网平台为该产品颁发的全局唯一标识。

出参

参数

参数类型

子参数

子参数类型

描述

result

boolean

-

-

调用结果:true。

调用示例

import { router } from 'aliyun-livinglink-sdk';

router.toLocalTimer({
 iotId:'xxx'
}).then((res)=>{
   console.log(res)
})

API支持度

云智能

自有品牌

天猫精灵

✔︎

✔︎

✔︎

跳转到设备端上定时插件

toDeviceTimer

请求参数

参数

参数类型

子参数

子参数类型

描述

是否必填

deviceIdentity

object

iotId

string

设备ID,生活物联网平台为设备颁发的ID,设备的唯一标识符。

productKey

string

产品的Key,设备证书信息之一。创建产品时,生活物联网平台为该产品颁发的全局唯一标识。

skillId

int

技能ID

天猫精灵App必填

出参

参数

参数类型

子参数

子参数类型

描述

result

boolean

-

-

调用结果:true。

调用示例

import { router } from 'aliyun-livinglink-sdk';

router.toDeviceTimer({
 iotId:'xxx',
 productKey:'xxx'
}).then((res)=>{
   console.log(res)
})

API支持度

云智能

自有品牌

天猫精灵

✔︎

✔︎

✔︎