iOS Headless PIN Authenticator
HYPR SDK for iOS: iOS Authenticators
HYPR SDK for iOS provides the ability to submit a PIN programmatically using the Headless PIN Authenticator.
Visibility
The view must still be presented, but users will not be required to enter a PIN.
Integration Guide
- Import the Headless PIN Authenticator.
#import <HYPRPINHeadless/HYPRPINHeadless.h>
- Configure the Authenticator with the desired parameters.
internal func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
[HYPRUAFClient registerAuthenticatorModule:[HYPRPINHeadlessAsm class]];
UIViewController *anInvisiblePINViewController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"idForInvisiblePINViewController"];
[HYPRPINHeadlessController.sharedInstance setPinLength:@6];
[HYPRPINHeadlessController.sharedInstance setEnrollmentViewController:anInvisiblePINViewController];
[HYPRPINHeadlessController.sharedInstance setVerificationViewController:anInvisiblePINViewController];
}
- Call registration within your
ViewController
.
NSString *pinToSubmit = <Get PIN from somewhere>;
[HYPRUserAgent setParentViewController:self];
// This will present the invisible PIN screen assuming the action id has the headless PIN
[[HYPRUserAgent sharedInstance] registerUserWithName:nil action:<policy with the headless PIN authenticator> completion:^(NSError * _Nullable error) {
// Handle error
}];
- Submit the PIN and handle the response.
[HYPRPINHeadlessController.sharedInstance submitPIN:self.pinTextField.text onPinSubmitted:^(BOOL success, int numberOfRetriesLeft) {
if(success) {
// Handle success
}
else {
// Handle failure (You'll most likely want to cancel the operation as the user won't be able to enter the PIN again in the invisible PIN view controller)
[HYPRPINHeadlessController.sharedInstance cancel];
}
}];
Updated 5 months ago