Keyri.primary constructor
Keyri.primary(
- dynamic appKey, {
- String? publicApiKey,
- String? serviceEncryptionKey,
- KeyriDetectionsConfig? detectionsConfig,
Pass required appKey for given Origin. Provide optional publicApiKey and serviceEncryptionKey parameters to use fraud prevention and mobile fingerprinting. Set blockEmulatorDetection parameter to false if you want to deny run your app on emulators, true by default.
Implementation
Keyri.primary(appKey,
{String? publicApiKey,
String? serviceEncryptionKey,
KeyriDetectionsConfig? detectionsConfig}) {
_appKey = appKey;
_publicApiKey = publicApiKey;
_serviceEncryptionKey = serviceEncryptionKey;
if (detectionsConfig != null) {
_detectionsConfig = detectionsConfig;
}
if (_appKey.isEmpty) {
throw Exception('You need to specify appKey');
}
KeyriPlatform.instance
.initialize(
_appKey, _publicApiKey, _serviceEncryptionKey, _detectionsConfig)
.then((isInitialized) => {
if (!isInitialized)
{throw Exception('Failed to initialize Keyri')}
});
}