docs/api/open-app-authorize-setting.md
::: sourceCode
GitCode: https://gitcode.com/dcloud/uni-api/tree/alpha/uni_modules/uni-openAppAuthorizeSetting
GitHub: https://github.com/dcloudio/uni-api/tree/alpha/uni_modules/uni-openAppAuthorizeSetting
:::
跳转系统授权管理页
| Web | 微信小程序 | Android | iOS | iOS uni-app x UTS 插件 | HarmonyOS | HarmonyOS(Vapor) |
|---|---|---|---|---|---|---|
| <a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a> | 4.41 | 4.51 | 4.51 | 4.51 | 4.61 | 5.0 |
注:App平台其实早期版本也可以使用
| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |
|---|---|---|---|---|---|
| options | OpenAppAuthorizeSettingOptions | 是 | - | Web: x; 微信小程序: -; Android: -; iOS: -; HarmonyOS: - |
| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |
|---|---|---|---|---|---|
| success | (result: OpenAppAuthorizeSettingSuccess) => void | 否 | null | Web: x; 微信小程序: -; Android: 4.51; iOS: 4.51; iOS uni-app x UTS 插件: 4.51; HarmonyOS: 4.61; HarmonyOS(Vapor): 5.0 | 接口调用成功的回调函数 |
| fail | (result: OpenAppAuthorizeSettingFail) => void | 否 | null | Web: x; 微信小程序: -; Android: 4.51; iOS: 4.51; iOS uni-app x UTS 插件: 4.51; HarmonyOS: 4.61; HarmonyOS(Vapor): 5.0 | 接口调用失败的回调函数 |
| complete | (result: OpenAppAuthorizeSettingComplete) => void | 否 | null | Web: x; 微信小程序: -; Android: 4.51; iOS: 4.51; iOS uni-app x UTS 插件: 4.51; HarmonyOS: 4.61; HarmonyOS(Vapor): 5.0 | 接口调用结束的回调函数(调用成功、失败都会执行) |
| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |
|---|---|---|---|---|---|
| errMsg | string | 是 | - | Web: x; 微信小程序: -; Android: 4.51; iOS: 4.51; iOS uni-app x UTS 插件: 4.51; HarmonyOS: 4.61; HarmonyOS(Vapor): 5.0 | 错误信息 |
| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |
|---|---|---|---|---|---|
| errMsg | string | 是 | - | Web: x; 微信小程序: -; Android: 4.51; iOS: 4.51; iOS uni-app x UTS 插件: 4.51; HarmonyOS: 4.61; HarmonyOS(Vapor): 5.0 | 错误信息 |
| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |
|---|---|---|---|---|---|
| errMsg | string | 是 | - | Web: x; 微信小程序: -; Android: 4.51; iOS: 4.51; iOS uni-app x UTS 插件: 4.51; HarmonyOS: 4.61; HarmonyOS(Vapor): 5.0 | 错误信息 |
示例为hello uni-app x alpha分支,与最新HBuilderX Alpha版同步。与最新正式版同步的master分支示例另见
该 API 不支持 Web,请运行 hello uni-app x 到 App 平台体验
::: preview
<template>
<!-- #ifdef APP -->
<scroll-view style="flex:1">
<!-- #endif -->
<button type="primary" style="margin: 20px;" @tap="go">跳转系统授权管理页</button>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script setup lang="uts">
const go = () => {
uni.openAppAuthorizeSetting({
success (res) {
console.log(res)
}
})
}
defineExpose({
go
})
</script>
<style>
</style>
:::
示例为hello uni-app x alpha分支,与最新HBuilderX Alpha版同步。与最新正式版同步的master分支示例另见
该 API 不支持 Web,请运行 hello uni-app x 到 App 平台体验
::: preview
<template>
<!-- #ifdef APP -->
<scroll-view style="flex:1">
<!-- #endif -->
<button type="primary" style="margin: 20px;" @tap="go">跳转系统授权管理页</button>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script setup lang="uts">
const go = () => {
uni.openAppAuthorizeSetting({
success (res) {
console.log(res)
}
})
}
defineExpose({
go
})
</script>
<style>
</style>
:::
| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |
|---|---|---|---|---|---|
| errMsg | string | 是 | - | Web: -; 微信小程序: 4.41; Android: -; iOS: -; HarmonyOS: - | 错误信息 |