2013-09-23 11 views
5

चूंकि ऐप्पल ने एक्सकोड 5 जारी किया है जिसमें आईओएस 7 में फिंगरप्रिंट स्कैनिंग की सुविधा है, क्या हम इसे अपने ऐप में कार्यान्वित कर सकते हैं? यदि हां, जो हम एसडीके कार्यान्वयन के लिए उपयोग करते हैं।आईओएस फिंगरप्रिंट कार्यान्वयन

कृपया एक नमूना कोड प्रदान करें या अन्यथा निर्दिष्ट करें कि हम कौन सा एसडीके उपयोग करते हैं।

+0

@rckoenes सही पढ़ा यह (https के बारे में 'सेब देव केंद्र मंच discussion' है:

यहाँ उसी के लिए कोड का टुकड़ा है // devforums.apple.com/message/884859#884859) –

उत्तर

1

यह LAContext (स्थानीय प्रमाणीकरण ढांचे) जो एक सुरक्षा policy.It चेकों का मूल्यांकन करने के इस्तेमाल किया जा सकता का उपयोग कर, टच आईडी सेंसर का उपयोग कर, उस व्यक्ति को प्रमाणीकरण डिवाइस स्वामी है के द्वारा प्राप्त किया जा सकता है। भविष्य में अन्य सुरक्षा नीतियां हो सकती हैं। [? फ़िंगरप्रिंट संवेदक अन्य एप्लिकेशन के लिए उपलब्ध है]

-(void)handlerForFingerTouch{ 
    LAContext *context = [[LAContext alloc] init]; 

    NSError *error = nil; 
    if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) { 
     [context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics 
       localizedReason:@"Are you the device owner?" 
         reply:^(BOOL success, NSError *error) { 

      if (error) { 
       UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" 
                   message:@"There was a problem verifying your identity." 
                   delegate:nil 
                cancelButtonTitle:@"Ok" 
                otherButtonTitles:nil]; 
       [alert show]; 
       return; 
      } 

      if (success) { 
       UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Success" 
                   message:@"You are the device owner!" 
                   delegate:nil 
                cancelButtonTitle:@"Ok" 
                otherButtonTitles:nil]; 
       [alert show]; 

      } else { 
       UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" 
                   message:@"You are not the device owner." 
                   delegate:nil 
                cancelButtonTitle:@"Ok" 
                otherButtonTitles:nil]; 
       [alert show]; 
      } 

     }]; 

    } else { 

     UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" 
                 message:@"Your device cannot authenticate using TouchID." 
                 delegate:nil 
              cancelButtonTitle:@"Ok" 
              otherButtonTitles:nil]; 
     [alert show]; 

    } 
} 
4

कोई फिंगरप्रिंट स्कैनर डेवलपर्स के लिए उपलब्ध नहीं है, यह वर्तमान एसडीके में उपलब्ध है।

आगामी आईओएस 8 एसडीके के साथ आप आधिकारिक एसडीके के माध्यम से फिंगरप्रिंट्सकेनर का उपयोग करने में सक्षम होंगे।

आप What's New in iOS: iOS8 दस्तावेज़ में TouchID के बारे में अधिक पढ़ सकते हैं।

+0

यह आईओएस 8 में बदल रहा है। – zaph

+0

@Zaph आप सही हैं, लेकिन चूंकि मैं अपने सभी पोस्ट के माध्यम से नहीं जाता हूं और हर बार एक नया एसडीके इस जवाब को बदलता हूं अद्यतन नहीं है – rckoenes

संबंधित मुद्दे