iOS指纹识别
#import "ViewController.h"
#import <LocalAuthentication/LocalAuthentication.h>
@interface ViewController ()
@end
@implementation ViewController
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
//指纹识别核心代码 // 创建本地认证上下文
LAContext *context = [[LAContext alloc] init];
// 检验设备是否支持指纹识别
// Biometrics:生物统计学 ,这里就是指纹识别
if(![context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:nil]){
NSLog(@"你的设备不支持指纹识别!");
return;
}
// 进行指纹识别
// localizedReason: 你为什么需要指纹识别
[context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:@"支付请录入指纹" reply:^(BOOL success, NSError * _Nullable error) {
if (success) {
NSLog(@"指纹识别成功");
}else{
NSLog(@"指纹识别失败:%@",error);
}
}];
}
@end
iOS指纹识别的更多相关文章
- iOS指纹识别Touch ID的安全性探讨
苹果公司在 iPhone 5s 的发布会上公布了全新的指纹识别安全技术,也就是 Touch ID,开创了生物安全识别技术在便携设备上使用的新篇章.此后,苹果还将此技术带到了 iPad 上.此前没有任何 ...
- IOS指纹识别调用
最近正在开发的一个app需要加入指纹识别的功能,先搜索一下找到官方文档,简单易懂: https://developer.apple.com/library/ios/documentation/Loca ...
- IOS 指纹识别的简单使用
首先导入LocalAuthentication框架 然后导入头文件 #import <LocalAuthentication/LAPublicDefines.h> - (void)begi ...
- iOS指纹识别代码
1:添加LocalAuthentication.framework框架 2:实现过程 #import "ViewController.h" #import <LocalAut ...
- ios 指纹识别解锁
:添加LocalAuthentication.framework框架 :实现过程 #import "ViewController.h" #import <LocalAuthe ...
- iOS - TouchID 指纹识别
前言 NS_CLASS_AVAILABLE(10_10, 8_0) @interface LAContext : NSObject 指纹识别功能是 iPhone 5s 推出的,SDK 是 iOS 8. ...
- ios开发-指纹识别
最近我们使用支付宝怎么软件的时候,发现可以使用指纹了,看起来是否的高大上.当时苹果推出了相关接口,让程序写起来很简单哈. 在iPhone5s的时候,苹果推出了指纹解锁.但是在ios8.0的时候苹果才推 ...
- 指纹识别人脸识别 iOS
//1.判断iOS8及以后的版本 if([UIDevice currentDevice].systemVersion.doubleValue >= 8.0){ //从iPhone5S开始,出现指 ...
- iOS 钥匙串 指纹识别 get和Post请求的区别
01-钥匙串 1. 通过系统提供的钥匙串功能可以在本地保存密码,系统使用AES的方式对密码加密 a. 查看Safari中保存的密码 2. 使用第三方框架SSKeychain把密码保存到钥匙串和获取钥匙 ...
随机推荐
- 基于Pojo的开发模式(day03)
上一次的文章讨论到了Spring的设计目标:使得JEE开发更易用. ok,作为一个Java开发人员,应该都知道struts这个框架,不知道是否大家都清楚struts1和struts2的区别. 首先,这 ...
- hdu 2143 数组合并 二分
Can you find it? Time Limit: 10000/3000 MS (Java/Others) Memory Limit: 32768/10000 K (Java/Others ...
- C#窗体嵌套
1.思路:在一个面板上显示或者隐藏不同窗体 private void button1_Click(object sender, EventArgs e) { chuangti at = new chu ...
- [每日一题] OCP1z0-047 :2013-07-30 表连接――内联视图当作表使用
用sys用户登录,给oe用户授权dba,以便可以用oe用户查看执行计划: oe@OCM> conn / as sysdba Connected. sys@OCM> grant dba to ...
- 如何让你的 footer 总是在浏览器底部无论什么分辨率无论什么浏览器?
一个可以用的CSS驱动的可粘在底部的Footer 我们曾经都或多或少的试过用CSS来把Footer固定在底部的经理,但是他们总是不能正常的粘在底部,不是吗?可喜的是,痛苦的研究如何让footer粘在底 ...
- Manasa and Stones
from __future__ import print_function def main(): t = int(raw_input()) for _ in range(t): n = int(ra ...
- nodejs应用mysql(纯属翻译)
原文点击这里 目录 Install Introduction Contributors Sponsors Community Establishing connections Connection o ...
- Golden Pyramid
Golden Pyramid Our Robo-Trio need to train for future journeys and treasure hunts. Stephan has built ...
- uva 10401 Injured Queen Problem(dp)
题目链接:10401 - Injured Queen Problem 题目大意:给出一个字符串,要求在n * n(n为字符串的长度)的棋盘上摆放n个受伤的皇后,受伤的皇后只能攻击到同一列和它周围8个格 ...
- Lucene.net常见功能实现知识汇总
在开发SearchEasy Site SearchEngine(搜易站内搜索引擎)的时候,经常会遇到一些搜索引擎的常见功能如何实现的问题,比如实现相关度百分比显示?如何实现在结果中搜索等等诸如此类常见 ...