Quick Start

HYPR SDK for iOS

HYPR SDK for IOS Setup

  1. Create a group to contain the frameworks and place the HYPR Frameworks in the group:
413
  1. Embed and link the HYPR Frameworks.
1486
  1. Enable the authenticator in the code. Typically this is done during App startup, so you can place it within the application(_ application:, didFinishLaunchingWithOptions launchOptions:) method of your AppDelegate class, found in /HYPRiOSReference/HYPRReferenceApp-Swift/<module_name>/AppDelegate.swift. The example here is for the /ComputerUnlock module:
//
//  AppDelegate.swift
//  HYPRComputerUnlock
//
//  Created by HYPR Corp
//  Copyright Β© 2020 HYPR Corp. All rights reserved.
//

import UIKit
import HyprCore

@UIApplicationMain

class AppDelegate: UIResponder, UIApplicationDelegate {
    
    var window: UIWindow?
        
    internal func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        
        HYPRWrapper.initHYPRForComputerUnlock(httpHeaderAdapter: httpHeaderAdapter())
        
        if let viewController = window?.rootViewController as? WorkstationProfileViewController {
            viewController.hyprWrapper = HYPRWrapper.shared
        }
                
        return true
    }
    
    func httpHeaderAdapter() -> HTTPHeaderAdapter {
        let httpHeaderAdapter = HTTPHeaderAdapter.shared
        httpHeaderAdapter.deviceInfo = DeviceInfo()
        return httpHeaderAdapter
    }
}
  1. The HYPR UserAgentProfile is defined in /HYPRiOSReference/HYPRReferenceApp-Swift/General/HYPRWrapper.swift; it points to the HYPR server URL and Relying Party Application ID. It allows your application to communicate with the designated HYPR server and Relying Party Application ID. In the example below we have defined
//
//  HYPRWrapper.swift
//  HYPRReferenceApp-Swift
//
//  Created by HYPR Corp 
//  Copyright Β© 2020 HYPR Corp. All rights reserved.
//

import UIKit
import HyprCore
import HYPRFingerprint
import HYPRFaceID
import HYPRPIN
import HYPRPresence
import HYPRSilent

class HYPRWrapper: HYPRWrapperProtocol {
    
		. . .
  
    class func createProfile(_ serverUrl: String, _ relyingPartyAppId: String) {
        let profileConfig = HYPRUserAgentProfileConfiguration(rpAppId: relyingPartyAppId,
                                                       rpServerUrl: serverUrl,
                                                       deviceType: "WEB",
                                                       rpSSLPinCredentials: nil,
                                                       additionalData: nil,
                                                       negotiatedReleaseVersion: nil,
                                                       versionControlItems: nil)

        // Create the profile with the profile configuration
        let profile = HYPRUserAgentProfile(displayName: "MobileAppUnlock", configuration: profileConfig, persona: nil, userAccounts: nil, apiEndpoints: nil)
        // Register it
        HYPRUserAgent.sharedInstance().registerProfile(profile)
    }
    
    class func profileExists() -> Bool {
        return HYPRUserAgent.sharedInstance().activeProfile() != nil
    }
  
  . . . 
}

What's Next?

Now that you've setup the HYPR SDK in your iOS application, Login to your mobile application or learn more about the building blocks behind HYPR SDK for iOS:

Use Cases

Methods