Specifying LUNA PLATFORM URL and handler IDs#
To guarantee interaction of LUNA ID with LUNA PLATFORM 5, you need to specify the URL to LUNA PLATFORM 5. This URL will be used to send requests to LUNA PLATFORM 5.
Along with the the URL to LUNA PLATFORM 5, you need to specify IDs of LUNA PLATFORM 5 handlers so you can perform the required tasks.
In LUNA ID for Android#
Specify the baseUrl
variable to provide the URL to LUNA PLATFORM 5 in the build.gradle.kts file. Consider the following example:
class DemoApp : Application () {
override fun onCreate() {
super.onCreate()
...
LunaID.apiHuman
// specify the URL to LUNA PLATFORM
val baseUrl = "http://luna-platform.com/api/6/"
}
}
The example has the following components:
Component | Description |
---|---|
LunaID.apiHuman |
Property. Provides access to the LUNA PLATFORM API and allows sending requests. |
baseUrl |
Variable. Specifies the LUNA PLATFORM URL that is used by the LunaID.apiHuman() function. |
To specify LUNA PLATFORM 5 handler IDs, define variables that correspond to the required handlers in constantHeaders
. For details, see the PlatformAPIExample example.
In LUNA ID for iOS#
Specify the following parameters in the LCLunaConfiguration
object at the app start:
Parameter | Description |
---|---|
identifyHandlerID |
The ID of a handler that receives the best shot and identification according to the existing list of faces. |
registrationHandlerID |
The ID of a handler that registers a new user and receives the best shot and user name. |
verifyID |
The ID of a verifier used to roll out LUNA PLATFORM 5. |
lunaServerURL |
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
}