README
Gizwits 隐私使用
插件提供查询隐私授权状态及请求授权的功能。
支持平台
- iOS
插件安装移除
# 安装
cordova plugin add cordova-gizwits-privacy-permission
# 移除
cordova plugin rm cordova-gizwits-privacy-permission
接口使用说明
获取隐私授权状态 getAuthorizationStatus
// 隐私类型 type = "location"; cordova.plugins.gizPrivacyPermission.getAuthorizationStatus(type, func (status) { // status 授权状态值。请参照状态值表。 }, func (errorMessage) { // errorMessage 错误信息 });
该接口支持的隐私类型如下:
类型 描述 系统版本支持 photo 图库/照片 camera 相机 media 音乐/视频 iOS 9.3 及以上 microphone 麦克风 location 定位 push-notification 推送 speech 语音识别/听写 iOS 10.0 及以上 event 日历事件 reminder 提醒事项 contact 联系人 iOS 9.0 及以上 请求授权 requestAuthorization
// 隐私类型 type = "location-always"; cordova.plugins.gizPrivacyPermission.requestAuthorization(type, func (status) { // status 授权状态值。请参照状态值表。 }, func (errorMessage) { // errorMessage 错误信息 });
该接口支持的隐私类型如下:
类型 描述 系统版本支持 photo 图库/照片 camera 相机 media 音乐/视频 iOS 9.3 及以上 microphone 麦克风 location-always 总是允许使用位置信息 location-when-in-use App运行期间使用位置信息 speech 语音识别/听写 iOS 10.0 及以上 event 日历事件 reminder 提醒事项 contact 联系人 iOS 9.0 及以上
状态值表
授权状态值 | 描述 |
---|---|
0 | 未授权 Authorization status not determined |
1 | 功能不可用 Authorization status restricted |
2 | 拒绝授权 Authorization status denied |
3 | 已授权 Authorization status authorized |
4 | 位置功能总是可用 Authorization status authorized location always |
5 | 位置功能在App运行时可用 Authorization status authorized location when in use |
6 | 未知状态 Authorization status unknown |