uni.openAppAuthorizeSetting(options)
跳转系统授权管理页
openAppAuthorizeSetting 兼容性
| Web | 微信小程序 | Android | iOS | iOS uni-app x UTS 插件 | HarmonyOS | HarmonyOS(Vapor) |
| x | 4.41 | 4.51 | 4.51 | 4.51 | 4.61 | 5.0 |
注:App平台其实早期版本也可以使用
参数
| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |
| options | OpenAppAuthorizeSettingOptions | 是 | - | |
Web
|
微信小程序
|
Android
|
iOS
|
HarmonyOS
| | x | - | - | - | - |
| |
| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 | | success | (result: OpenAppAuthorizeSettingSuccess) => void | 否 | null | |
Web
|
微信小程序
|
Android
|
iOS
|
iOS uni-app x UTS 插件
|
HarmonyOS
|
HarmonyOS(Vapor)
| | x | - | 4.51 | 4.51 | 4.51 | 4.61 | 5.0 |
| 接口调用成功的回调函数 | | fail | (result: OpenAppAuthorizeSettingFail) => void | 否 | null | |
Web
|
微信小程序
|
Android
|
iOS
|
iOS uni-app x UTS 插件
|
HarmonyOS
|
HarmonyOS(Vapor)
| | x | - | 4.51 | 4.51 | 4.51 | 4.61 | 5.0 |
| 接口调用失败的回调函数 | | complete | (result: OpenAppAuthorizeSettingComplete) => void | 否 | null | |
Web
|
微信小程序
|
Android
|
iOS
|
iOS uni-app x UTS 插件
|
HarmonyOS
|
HarmonyOS(Vapor)
| | x | - | 4.51 | 4.51 | 4.51 | 4.61 | 5.0 |
| 接口调用结束的回调函数(调用成功、失败都会执行) |
|
OpenAppAuthorizeSettingSuccess 的属性值
| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |
| errMsg | string | 是 | - | |
Web
|
微信小程序
|
Android
|
iOS
|
iOS uni-app x UTS 插件
|
HarmonyOS
|
HarmonyOS(Vapor)
| | x | - | 4.51 | 4.51 | 4.51 | 4.61 | 5.0 |
| 错误信息 |
OpenAppAuthorizeSettingFail 的属性值
| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |
| errMsg | string | 是 | - | |
Web
|
微信小程序
|
Android
|
iOS
|
iOS uni-app x UTS 插件
|
HarmonyOS
|
HarmonyOS(Vapor)
| | x | - | 4.51 | 4.51 | 4.51 | 4.61 | 5.0 |
| 错误信息 |
OpenAppAuthorizeSettingComplete 的属性值
| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |
| errMsg | string | 是 | - | |
Web
|
微信小程序
|
Android
|
iOS
|
iOS uni-app x UTS 插件
|
HarmonyOS
|
HarmonyOS(Vapor)
| | x | - | 4.51 | 4.51 | 4.51 | 4.61 | 5.0 |
| 错误信息 |
示例
示例为hello uni-app x alpha分支,与最新HBuilderX Alpha版同步。与最新正式版同步的master分支示例另见
该 API 不支持 Web,请运行 hello uni-app x 到 App 平台体验
扫码体验 示例源码如下,请查看 pre > code 标签中的内容
<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 平台体验
扫码体验 示例源码如下,请查看 pre > code 标签中的内容
<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>
通用类型
GeneralCallbackResult
| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |
| errMsg | string | 是 | - | |
Web
|
微信小程序
|
Android
|
iOS
|
HarmonyOS
| | - | 4.41 | - | - | - |
| 错误信息 |