ios開發之指紋識別

來源:互聯網
上載者:User

ios開發之指紋識別
iPhone 5s推出指紋識別, 在 iOS 8.0 蘋果開放了指紋識別的 SDK最重要的應用領域是支付要使用指紋識別功能,需要匯入一下標頭檔

#import 
核心代碼
if ([UIDevice currentDevice].systemVersion.floatValue < 8.0) {        NSLog(@"不支援");        return;    }    LAContext *ctx = [[LAContext alloc] init];    // 判斷裝置是否支援指紋識別    if ([ctx canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:NULL]) {        NSLog(@"支援");        // 輸入指紋,非同步        // 提示:指紋識別只是判斷目前使用者是否是手機的主人!程式原本的邏輯不會受到任何的幹擾!        [ctx evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:@"指紋登入" reply:^(BOOL success, NSError *error) {            NSLog(@"%d %@", success, error);            if (success) {                // 登入成功                // TODO            }        }];        NSLog(@"come here");    } else {        NSLog(@"不支援");    }

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.