> For AI agents: the complete documentation index is available at /apps-plugin/docs/llms.txt, the full documentation bundle is available at /apps-plugin/docs/llms-full.txt.

# openSetting

打开应用插件授权设置页面

## 扫码预览

![扫码预览 openSetting](https://api.qrserver.com/v1/create-qr-code/?size=200x200\&data=doubao%3A%2F%2Fdoubao_apps%3Fapp_id%3Ddb_1McM5Ni%26path%3D%252Fpages%252Fapi%252Fbasic%252Fopen-setting%252Findex)

## 支持版本

前端库版本不低于 `0.0.39`。

## 支持平台

<table>
<thead>
<tr><th>平台</th><th>支持情况</th></tr>
</thead>
<tbody>
<tr><td>Android</td><td>支持</td></tr>
<tr><td>iOS</td><td>支持</td></tr>
<tr><td>PC</td><td>不支持</td></tr>
<tr><td>HarmonyOS</td><td>不支持</td></tr>
</tbody>
</table>

## 支持场景

<table>
<thead>
<tr><th>场景</th><th>支持情况</th></tr>
</thead>
<tbody>
<tr><td>页面</td><td>支持</td></tr>
<tr><td>卡片</td><td>支持</td></tr>
</tbody>
</table>

## 接入准备

### 前置条件

- 无额外前置条件，不要求在用户点击事件中调用

## 使用说明

该接口不要求在用户点击事件中调用。
JavaScript 调用方也不要传入 `withSubscriptions: true`，否则豆包会返回 `subscription templates are not supported yet`。

- 设置页只能修改当前应用插件的 scope，不承载 HealthKit 系统权限设置。
- 豆包当前不支持订阅模板，不要传入 withSubscriptions: true。

## 调用方式

### 异步 API

```typescript
openSetting(params?: OpenSettingOptions): Promise<OpenSettingResult>
```

## 入参

<table>
<thead>
<tr><th>名称</th><th>类型</th><th>必填</th><th>默认值</th><th>约束</th><th>说明</th></tr>
</thead>
<tbody>
<tr><td><code>withSubscriptions</code></td><td><code>false</code></td><td>否</td><td><code>false</code></td><td>豆包 Android、iOS 当前不支持订阅模板，仅支持 false</td><td>是否同时获取用户订阅消息的订阅状态；当前仅支持 false。</td></tr>
</tbody>
</table>

## 调用示例

```typescript
import { openSetting } from '@doubao-dev/framework/api';

try {
  const result = await openSetting();
  console.log(result.authSetting['scope.userLocation']);
} catch (error) {
  console.error(error);
}
```

## 成功返回

<table>
<thead>
<tr><th>名称</th><th>类型</th><th>必返</th><th>说明</th></tr>
</thead>
<tbody>
<tr><td><code>authSetting</code></td><td><code>AuthSetting</code></td><td>是</td><td>用户授权结果，key 为权限 scope，value 表示是否已授权</td></tr>
<tr><td><code>subscriptionsSetting</code></td><td><code>SubscriptionsSetting</code></td><td>否</td><td>预留的订阅消息设置字段。豆包当前仅支持 `withSubscriptions: false`，因此不会返回该字段。</td></tr>
<tr><td><code>subscriptionsSetting.itemSettings</code></td><td><code>Record&lt;string, SubscriptionSettingStatus&gt;</code></td><td>否</td><td>一次性订阅消息模板的订阅状态</td></tr>
<tr><td><code>subscriptionsSetting.mainSwitch</code></td><td><code>boolean</code></td><td>否</td><td>设置页订阅消息总开关</td></tr>
<tr><td><code>subscriptionsSetting.templateSettings</code></td><td><code>Record&lt;string, SubscriptionTemplateSetting&gt;</code></td><td>否</td><td>模板订阅状态</td></tr>
</tbody>
</table>

### 返回示例

```json
{
  "authSetting": {
    "scope.userLocation": true,
    "scope.record": false
  }
}
```
