iPhone 5s Touch ID传感器API [英] iPhone 5s Touch ID sensor API

查看:141
本文介绍了iPhone 5s Touch ID传感器API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

经过大量传闻,苹果公司宣布新款iPhone 5s将配备生物识别指纹传感器(Touch ID)。

After a lot of rumors, Apple has announced the new iPhone 5s will have a biometric fingerprint sensor (Touch ID).

Apple已经发布了API / SDK这个传感器?如果是,可以提供一个例子吗?

Has apple already released the API/SDK for this sensor? If so, can an example be provided?

推荐答案

更新iOS> = 8



从iOS 8开始,这个答案的旧部分已不再适用。 Apple推出了本地身份验证框架,允许您在应用程序中使用Touch ID

Update iOS >= 8

As of iOS 8, the old part of this answer is no longer true. Apple has introduced the Local Authentication Framework, which allows you to utilize Touch ID in your applications

Quote +示例代码(本地认证框架参考

Quote + Sample code (Local Authentication Framework Reference)


本地身份验证框架提供了从具有指定安全策略的用户请求身份验证的工具。例如,要请求用户使用Touch ID进行身份验证,您可以使用以下代码:

The Local Authentication framework provides facilities for requesting authentication from users with specified security policies. For example, to request that the user authenticate using Touch ID you would use code such as this:



LAContext *myContext = [[LAContext alloc] init];
NSError *authError = nil;
NSString *myLocalizedReasonString = <#String explaining why app needs authentication#>;

if ([myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError]) {
    [myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
                  localizedReason:myLocalizedReasonString
                            reply:^(BOOL succes, NSError *error) {
            if (success) {
                // User authenticated successfully, take appropriate action
            } else {
                // User did not authenticate successfully, look at error and take appropriate action
            }
        }];
} else {
    // Could not evaluate policy; look at authError and present an appropriate message to user
}



旧答案iOS< 7



来自 9月10日2013年主题演讲大约61分钟的演示文稿:

Old answer iOS < 7

From the September 10, 2013 keynote approximately 61 minutes into the presentation:


所有指纹信息都经过加密并存储在安全区内
在我们的新A7芯片中。在这里,它被锁定远离其他所有东西,
只能通过Touch ID传感器访问。它永远不会被其他
软件使用,它从未存储在Apple的服务器上或备份到iCloud。

All fingerprint info is encrypted and stored inside the secure enclave in our new A7 chip. Here, it is locked away from everything else, accessible only by the Touch ID sensor. It’s never available to other software, it’s never stored on Apple’s servers or backed up to iCloud.

到目前为止,这是所有可用的信息。话虽如此,这是猜测,但我认为可能没有这方面的API。 如果任何事情,传感器的使用只会通过与钥匙串的互动来完成,从而允许操作系统与传感器进行交互,同时将您的应用分开放在舒适的小沙箱中。

As of yet, this is all the information that is available. That being said, this is speculation, but I think it's likely that there won't be an API for this. If anything, usage of the sensor, will only be done through interaction with the keychain allowing the OS to interact with the sensor, while keeping your app separate in its cozy little sandbox.

编辑:

看起来我们无法访问传感器。以下是ALLThingsD文章的引用(链接如下)。

It looks like it's true that we can't access the sensor. Here's a quote from an ALLThingsD article (linked below).


Apple高级副总裁Phil Schiller向AllThingsD证实
开发者获胜无法使用指纹作为
身份验证的手段。他拒绝评论未来是否会出现

Apple Senior Vice President Phil Schiller confirmed to AllThingsD that developers won’t get access to use a fingerprint as a means of authentication. He declined to comment on whether that might come in the future.

http://allthingsd.com/20130910/iphone-developers-wont- get-fingerprint-reader-authentication-option-for-now-anyway /

这篇关于iPhone 5s Touch ID传感器API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆