ios 系统权限检测
来源:互联网 发布:math js w3c 编辑:程序博客网 时间:2024/05/17 09:10
权限判断
// 是否有相册访问权限- (BOOL)checkPhotoAuth{ ALAuthorizationStatus author = [ALAssetsLibrary authorizationStatus]; if(author == ALAuthorizationStatusRestricted || author == ALAuthorizationStatusDenied){ //无权限 NSError *error = [NSError errorWithDomain:@"访问相册" code:-1 userInfo:@{NSLocalizedDescriptionKey : @"无权访问相册"}];}// 是否有相机访问权限- (BOOL)checkCameraAuth{ AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; if(authStatus == AVAuthorizationStatusRestricted || authStatus ==AVAuthorizationStatusDenied){ //无权限} // 定位权限 // 手机是否开启了定位服务 BOOL service = [CLLocationManager locationServicesEnabled]; // 方向服务是否支持 BOOL heading = [CLLocationManager headingAvailable]; // 后台位置刷新 BOOL backRefresh = [CLLocationManager significantLocationChangeMonitoringAvailable]; CLAuthorizationStatus status = [CLLocationManager authorizationStatus]; if (status == kCLAuthorizationStatusRestricted || status == kCLAuthorizationStatusDenied) { // 无权限 }
系统权限scheme
// 使用此方法打开系统设置NSURL*url=[NSURL URLWithString:@"prefs:root=WIFI"]; [[UIApplication sharedApplication] openURL:url]; 关于:About — prefs:root=General&path=About辅助功能:Accessibility — prefs:root=General&path=ACCESSIBILITY飞行模式:Airplane Mode On — prefs:root=AIRPLANE_MODE自动锁定:Auto-Lock — prefs:root=General&path=AUTOLOCK亮度:Brightness — prefs:root=Brightness蓝牙:Bluetooth — prefs:root=General&path=Bluetooth日期:Date & Time — prefs:root=General&path=DATE_AND_TIME视频:FaceTime — prefs:root=FACETIME通用:General — prefs:root=General键盘:Keyboard — prefs:root=General&path=KeyboardiCloud登录:iCloud — prefs:root=CASTLE语言和地区:International — prefs:root=General&path=INTERNATIONAL定位服务:Location Services — prefs:root=LOCATION_SERVICES音乐:Music — prefs:root=MUSIC备忘录:Notes — prefs:root=NOTES推送:Notification — prefs:root=NOTIFICATION相册:Photos — prefs:root=Photos描述文件:Profile — prefs:root=General&path=ManagedConfigurationList还原:Reset — prefs:root=General&path=Reset声音:Sounds — prefs:root=Sounds系统更新:Software Update — prefs:root=General&path=SOFTWARE_UPDATE_LINKAppStore:Store — prefs:root=STORE墙纸:Wallpaper — prefs:root=WallpaperWiFi:Wi-Fi — prefs:root=WIFI热点 — prefs:root=INTERNET_TETHERING指定应用设置:prefs:root=应用bundleID
更多权限
// 部分权限似乎不可用,跟上面的有重复,上面的权限已经测试过,真机都可以用#define About @"prefs:root=General&path=About"#define Accessibility @"prefs:root=General&path=ACCESSIBILITY"#define AirplaneModeOn @"prefs:root=AIRPLANE_MODE"#define AutoLock @"prefs:root=General&path=AUTOLOCK"#define Brightness @"prefs:root=Brightness"#define Bluetooth @"prefs:root=General&path=Bluetooth"#define DateTime @"prefs:root=General&path=DATE_AND_TIME"#define FaceTime @"prefs:root=FACETIME"#define General @"prefs:root=General"#define Keyboard @"prefs:root=General&path=Keyboard"#define iCloud @"prefs:root=CASTLE"#define iCloudStorageBackup @"prefs:root=CASTLE&path=STORAGE_AND_BACKUP"#define International @"prefs:root=General&path=INTERNATIONAL"#define LocationServices @"prefs:root=LOCATION_SERVICES"#define Music @"prefs:root=MUSIC"#define MusicEqualizer @"prefs:root=MUSIC&path=EQ"#define MusicVolumeLimit @"prefs:root=MUSIC&path=VolumeLimit"#define Network @"prefs:root=General&path=Network"#define NikeiPod @"prefs:root=NIKE_PLUS_IPOD"#define Notes @"prefs:root=NOTES"#define Notification @"prefs:root=NOTIFICATI*****_ID"#define Phone @"prefs:root=Phone"#define Photos @"prefs:root=Photos"#define Profile @"prefs:root=General&path=ManagedConfigurationList"#define Reset @"prefs:root=General&path=Reset"#define Safari @"prefs:root=Safari"#define Siri @"prefs:root=General&path=Assistant"#define Sounds @"prefs:root=Sounds"#define Software Update @"prefs:root=General&path=SOFTWARE_UPDATE_LINK"#define Store @"prefs:root=STORE"#define Twitter @"prefs:root=TWITTER"#define Usage @"prefs:root=General&path=USAGE"#define VPN @"prefs:root=General&path=Network/VPN"#define Wallpaper @"prefs:root=Wallpaper"#define WiFi @"prefs:root=WIFI"#define Hot @"prefs:root=INTERNET_TETHERING"
0 0
- ios 系统权限检测
- iOS系统越狱检测
- iOS系统越狱检测
- iOS系统越狱检测
- iOS 获取系统权限
- iOS 系统权限介绍
- iOS麦克风权限的检测和获取
- iOS隐私权限获取和检测
- Android 6.0 以下系统的权限检测
- 权限检测
- iOS 相机 麦克风 照片 权限的检测与获取
- Android中通过代码检测系统是否有root权限
- Android系统的Root权限获取与检测
- Android系统文件安全权限检测/system/build.prop修改
- iOS 系统相机和相册权限
- iOS 有关系统权限的问题
- iOS开发 系统各种权限请求 & 判断
- iOS系统定位权限弹出框和跳转系统设置
- 学String类后实现的简单习题
- Hadoop2.x + eclipse 插件配置
- test
- char *strtok(char *s, const char *delim) 用法
- 一个de两种意思——谈谈Dojo define 和declare的区别
- ios 系统权限检测
- linux sysfs api
- Java通过两个栈实现队列
- iOS中集成ijkplayer视频直播框架
- Are sparse representations really relevant for image classification?
- HDU 4352 XHXJ's LIS(数位dp+搜索)★
- Mac终端自动补全及常用命令
- HDU 1524 A Chess Game(SG博弈)
- 窗口显示不出来的Bug.