# addSceneToSiriShortcut ^7.8
添加快捷指令(iOS)
# 调用方式
addSceneToSiriShortcut(params)
1
返回 Promise,使用 then/catch 或 await 处理结果。 接收单个业务参数;是否需要传参按下方参数表约定,无业务参数时可省略。具体字段及返回数据由宿主原生约定。
# 请求参数
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| sceneId | String | Y | -- | ID |
| name | String | Y | -- | name |
| sceneName | String | Y | -- | name |
# 接口调用示例
this.$bridge.addSceneToSiriShortcut(params)
1
# 返回参数
| Prop | Type | Default | Description |
|---|---|---|---|
| status | Number | 1: 表示添加成功 |
# 接口返回示例
this.$bridge.addSceneToSiriShortcut(params).then((res) => {
// 添加Siri
if (+res.status === 1) {
this.hasSiri = true;
this.getSiriShortCut().then((getRes) => {
this.invocationPhrase = getRes.invocationPhrase;
this.$bridge.toast(this.TEXT.scene_detail_siri_create_succ);
this.$emit('updateSiri');
});
}
});
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11