Initial setup of LUNA ID for iOS#
This topic describes how to perform an initial setup of LUNA ID to start using it in your iOS projects.
Step 1. Add XCFrameworks#
To embed XCFrameworks into your app:
1․ Drag and drop the following .xcframework files from the LUNA ID installation package to the Frameworks, Libraries, and Embedded Content section of Xcode:
- flower.xcframework
File location: luna-id-sdk_ios_v.X.X.X\build\Release-iphoneos\frameworks\flower.framework\ - fsdk.xcframework
File location: luna-id-sdk_ios_v.X.X.X\build\Release-iphoneos\frameworks\fsdk.framework\ - LunaAuth.xcframework
File location: luna-id-sdk_ios_v.X.X.X\build\Release-iphoneos\frameworks\LunaAuth.framework\ - LunaCamera.xcframework
File location: luna-id-sdk_ios_v.X.X.X\build\Release-iphoneos\frameworks\LunaCamera.framework\ - LunaCore.xcframework
File location: luna-id-sdk_ios_v.X.X.X\build\Release-iphoneos\frameworks\LunaCore.framework\ - LunaWeb.xcframework
File location: luna-id-sdk_ios_v.X.X.X\build\Release-iphoneos\frameworks\LunaWeb.framework\ - tsdk.xcframework
File location: luna-id-sdk_ios_v.X.X.X\build\Release-iphoneos\frameworks\tsdk.framework\
2․ Make sure that all the files have the Embed label so that they will be bundled with your final app. Otherwise, your app will crash at start.
Step 2. Enable OneShotLiveness estimation#
To enable OneShotLiveness estimation, specify the the following parameters in the LCLunaConfiguration
object at the app start:
Parameter | Description |
---|---|
verifyID |
The ID of a verifier used to roll out LUNA PLATFORM 5. |
lunaServerURL |
Specifies the LUNA PLATFORM 5 host URL. The URL should not have the slash at the end. For example: https://LUNA_PLATFORM_HOST/6 . |
For example:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
...
let configuration = LCLunaConfiguration.defaultConfig()
configuration.identifyHandlerID = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
configuration.registrationHandlerID = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
configuration.verifyID = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
configuration.lunaAccountID = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
configuration.lunaServerURL = URL(string: "https://LUNA_PLATFORM_HOST/6")
...
return true
}
Step 3. Specify license data#
To specify LUNA ID license data:
1․ Request Server, EID, and ProductID from VisionLabs.
2․ In the fsdk.framework/data/license.conf file, specify the following parameters:
Parameter | Description |
---|---|
Server |
Activation server URL. |
EID |
Entitlement ID. |
ProductID |
Product ID. |
For more information about LUNA ID license activation, see Licensing.
Step 4. Create a face recognition screen in your app#
To create a face recognition screen on which the video stream from the camera is displayed:
1․ Add the LMCameraBuilder.viewController()
method in the required part of your app.
2․ Specify the LCLunaConfiguration
object as an input parameter. It allows you to set various threshold values that affect the resulting recognition screen.