iOS SDK Integration Guide
- 1.
- 2.
- 3.
- Xcode 11.4+
- Swift 5.0
- iOS 11.0+
Please update to the latest SDK!
- 1.
- 2.
- 3.
The humanID SDK is available through CocoaPods.
To install it, simply add the following line to your Podfile:
pod 'HumanIDSDK'
Add this code to your AppDelegate.swift and make sure all the values are fulfilled.
import HumanIDSDK
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions
launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
HumanIDSDK.shared.configure(clientID: "YOUR_CLIENT_ID", clientSecret:
"YOUR_CLIENT_SECRET")
}
}
Add this code to your ViewController file. We recommend you wrap this in a function that handles the login button.
import HumanIDSDK
class YourViewController: UIViewController {
@IBAction func yourLoginAction(_ sender: Any) {
HumanIDSDK.shared.requestOtp(view: self, name: "YOUR_APPLICATION_NAME", image: "YOUR_APPLICATION_LOGO")
}
}
extension YourViewController: RequestOTPDelegate {
func login(with token: String) {
// TODO You can persist our token here.
}
}
Your iOS app should now be integrated with the humanID login.
- Warning! To run the example project, clone the repo, and run pod install from the Example directory first.
Last modified 1yr ago