zoukankan      html  css  js  c++  java
  • iOS跳转到Touch ID设置界面

    1.首先去info.plist 设置:

    2.代码

            NSURL *url = [NSURL URLWithString:@"App-Prefs:root=TOUCHID_PASSCODE"];
            if ([[UIApplication sharedApplication] canOpenURL:url])
            {
                [[UIApplication sharedApplication] openURL:url];
            }
    

      

    其它设置界面同理,url换成对应系统界面的参数 即可。

    3.touch id 代码示例

    - (void)touchID {
        LAContext *context = [[LAContext alloc]init];
        NSError *error = nil;
        if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) {
            [context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
                    localizedReason:@"为了保证数据安全性,必须开启指纹认证才能使用,谢谢!"
                              reply:^(BOOL success, NSError *error) {
                                  if (error) {
                                      NSLog(@"操作失败");
                                  }
                                  if (success) {
                                      NSLog(@"验证成功");
    } else { NSLog(@"验证失败"); } }]; } else { NSLog(@"TouchID设备不可用"); } }

      

    更多参数:

    About — App-Prefs:root=General&path=About  
    
    Accessibility — App-Prefs:root=General&path=ACCESSIBILITY  
    
    AirplaneModeOn— App-Prefs:root=AIRPLANE_MODE  
    
    Auto-Lock — App-Prefs:root=General&path=AUTOLOCK  
    
    Brightness — App-Prefs:root=Brightness  
    
    Bluetooth — App-Prefs:root=General&path=Bluetooth
    
    Date& Time — App-Prefs:root=General&path=DATE_AND_TIME  
    
    FaceTime — App-Prefs:root=FACETIME
    
    General— App-Prefs:root=General
    
    Keyboard — App-Prefs:root=General&path=Keyboard  
    
    iCloud — App-Prefs:root=CASTLE  iCloud 
    
    Storage & Backup — App-Prefs:root=CASTLE&path=STORAGE_AND_BACKUP  
    
    International — App-Prefs:root=General&path=INTERNATIONAL  
    
    Location Services — App-Prefs:root=LOCATION_SERVICES  
    
    Music — App-Prefs:root=MUSIC  
    
    Music Equalizer — App-Prefs:root=MUSIC&path=EQ  
    
    Music VolumeLimit— App-Prefs:root=MUSIC&path=VolumeLimit  
    
    Network — App-Prefs:root=General&path=Network  
    
    Nike + iPod — App-Prefs:root=NIKE_PLUS_IPOD  
    
    Notes — App-Prefs:root=NOTES  
    
    Notification — App-Prefs:root=NOTIFICATIONS_ID  
    
    Phone — App-Prefs:root=Phone  
    
    Photos — App-Prefs:root=Photos  
    
    Profile — App-Prefs:root=General&path=ManagedConfigurationList  
    
    Reset — App-Prefs:root=General&path=Reset  
    
    Safari — App-Prefs:root=Safari  Siri — App-Prefs:root=General&path=Assistant  
    
    Sounds — App-Prefs:root=Sounds  
    
    SoftwareUpdate— App-Prefs:root=General&path=SOFTWARE_UPDATE_LINK  
    
    Store — App-Prefs:root=STORE  
    
    Twitter — App-Prefs:root=TWITTER  
    
    Usage — App-Prefs:root=General&path=USAGE  
    
    VPN — App-Prefs:root=General&path=Network/VPN  
    
    Wallpaper — App-Prefs:root=Wallpaper  
    
    Wi-Fi — App-Prefs:root=WIFI
    
    Setting—App-Prefs:root=INTERNET_TETHERING
    

      

  • 相关阅读:
    服务器上传大小限制 --- 来自 FastAdmin 项目开发的引发的问题 (TODO)
    英语中的各种“破坏”
    PADS Layout CAM 的中高级焊盘选项
    FastAdmin 推荐 Git 在线学习教程
    Vue 将样式绑定到一个对象让模板更清晰
    jQuery动态的给页面中添加一条样式表的链接
    页面根据不同的情况添加不同的样式表
    jQuery屏蔽浏览器的滚动事件,定义自己的滚轮事件
    如何判断自己的浏览器支持的是javascript的那个版本
    ie下 iframe在页面中显示白色背景 如何去掉的问题
  • 原文地址:https://www.cnblogs.com/qiyer/p/7380147.html
Copyright © 2011-2022 走看看