humanID iOS SDK
General Documentation • Wiki • Integration • Contributing • Gallery • FAQ
Meet humanID - An anonymous online identity, enabling platforms to offer the speed and comfort of social logins, while guaranteeing absolute privacy and protecting our communities by permanently blocking bots, spams, and trolls.
Requirements
- Xcode 11.4+
- Swift 5.0
- iOS 11.0+
- Clean Swift VIP architecture
Please update to the latest SDK!
Built with
- Swinject - Dependency injection framework for Swift with iOS/macOS/Linux
- RxSwift - Reactive Programming in Swift
- RxAlamofire - RxSwift wrapper around the elegant HTTP networking in Swift Alamofire
- FlagPhoneNumber - A formatted phone number UITextField with country flag picker.
- VKPinCodeView - VKPinCodeView is simple and elegant UI component for input PIN. You can easily customise appearance and get auto fill (OTP) iOS 12 feature right from the box.
- IQKeyboardManager - Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView. Neither need to write any code nor any setup required and much more.
- PodAsset - Unable to find cocoapods resources? Here is the solution!
Installation
HumanIDSDK is available through CocoaPods.
To install it, simply add the following line to your Podfile:
pod 'HumanIDSDK'
Get the credentials access
Get the clientId and clientSecret by dropping us an email developers@human-id.org.
Configuration
Add these codes into your AppDelegate.swift
and make sure all value is fulfilled.
import HumanIDSDK
@UIApplicationMain
final 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")
}
}
How do I use iOS SDK
Add these codes into your ViewController file, we recommend you wrap this in a function that handles the login button.
import HumanIDSDK
final class YourViewController: UIViewController {
@IBAction func yourLoginAction(_ sender: Any) {
HumanIDSDK.shared.requestOtp(from: self, name: "YOUR_APPLICATION_NAME", image: "YOUR_APPLICATION_LOGO")
}
}
extension YourViewController: RequestOTPDelegate {
func login(with token: String) {
// TODO You can persist our token here.
}
}
You are set!
Now you can integrate your iOS app to humanID. See the full sample here to learn more.
Warning!
To run the example project, clone the repo, and run pod install
from the Example directory first.
License
Copyright 2019-2020 Bluenumber Foundation
Licensed under the GNU General Public License v3.0 (LICENSE)