Integration guide#
Applies to LUNA ID for iOS only.
This guide provides a step-by-step overview of integrating LUNA ID into an iOS application.
Step 1: Project setup#
- Create a new empty iOS application project in Xcode.
- Get the vllicense.plist license file from your VisionLabs contact.
- Add vllicense.plist to your Xcode project as a resource file.
- Download the following required frameworks:
- CheckJailBreakDevice.xcframework
- CryptoSwift.xcframework
- fsdk.xcframework
- tsdk.xcframework
- LunaCamera.xcframework
- LunaCore.xcframework
- LunaWeb.xcframework
- Place all .xcframework files in your application folder.
- Drag and drop the frameworks into the General > Frameworks, Libraries, and Embedded Content section of your application target in Xcode.
- Set the embedding option for each framework to Embed & Sign to ensure they are included in your application bundle.
Step 2: ViewController setup#
1․ Define pipeline estimations
Before presenting the camera interface, configure the estimations you want to include in the LUNA ID pipeline. These estimations are managed using the LunaCore.LCLunaConfiguration
class.
- Create an instance of
LCLunaConfiguration
. - Customize its properties to match your requirements.
2․ Create the camera view controller
- Use
LunaCamera.LMCameraBuilder.viewController()
to create an instance ofLMCameraViewControllerProtocol
. - Pass the configured
LCLunaConfiguration
object as an input parameter.
Step 3: UI customization#
The LunaCamera.LMCameraBuilder.viewController()
method gets as an input parameter object of class LunaCamera.LMCustomization
, which allows you to customize the UI.
The main customization object is the LunaCamera.LMCustomization
class. To use it, create an instance of the LunaCamera.LMCustomization
class. It contains the uiCustomizer
property of the LunaCamera.LMUICustomizerProtocol
protocol. You can create your own implementation of LunaCamera.LMUICustomizerProtocol
methods which will return your views implementation and will be used as overlay for video feed.
LunaCamera.LMUICustomizerProtocol
supports customization of the following components:
Face tracking frame#
func faceDetectionFrameView() -> LMFaceDetectionViewProtocol
This method returns a custom view that tracks the position of the face in the video feed. The returned view must conform to the LMFaceDetectionViewProtocol
.
Required methods:
switchToPositiveState()
: Called when the face tracking process is successful.switchToNegativeState()
: Called when there is an issue with the face in the video feed.
Important: LUNA ID can modify the
LunaCamera.LMFaceDetectionViewProtocol
frame at any time. It affects size and position of view.
Notification view#
func videoStreamNotificationView() -> LMVideoStreamNotificationViewProtocol
This method returns a custom view for displaying notifications on top of the video feed.
Required methods:
showNotificationMessage
: Triggered when a notification needs to be displayed.notificationMessage
: Returns the current notification message.
The default implementation of LunaCamera.LMVideoStreamNotificationViewProtocol
is the LunaCamera.LMVideoStreamNotificationView
class. You can use LunaCamera.LMVideoStreamNotificationView
class and customize font or text color:
- Use
applyFont(_ useFont: UIFont)
to change the font. - Use
applyTextColor(_ color: UIColor)
to change the text color.
Root customization view#
func rootCustomizationView() -> UIView
This method returns a custom UIView that overlays the video feed. You can use it as a container for additional UI elements.