Initializing the SDK
To use the SDK’s methods and classes, your application must call the SDK’s
initialize
method to initialize the
MobileCredentialVerifier
class:
Initializing the SDK
func initialize(
platformConfiguration: PlatformConfiguration? = nil,
loggerConfiguration: LoggerConfiguration = LoggerConfiguration()
) throws
Configure verifier for app-to-app verification
You can configure MATTR VII platform parameters in the SDK to enable app-to-app verification using
the
PlatformConfiguration
structure:
Platform Configuration
do {
try mobileCredentialShared
.initialize(
platformConfiguration: PlatformConfiguration(
tenantHost: URL(string: platformConfigurations.tenantHost), // Tenant subdomain
applicationId: platformConfigurations.applicationId // ID of web application that will be used for verification
)
)
}
catch {
print(error.localizedDescription)
}
Configure logger behavior
You can configure the SDK’s logger behavior using the optional loggerConfiguration
parameter:
Configure logger behavior
init() {
do {
let loggerConfiguration = LoggerConfiguration(
logLevel: .Debug,
callbackLogLevel: .Debug) { event in
print(
"Perform any custom action with the log event: \(event.message)"
)
}
mobileCredentialVerifier = MobileCredentialVerifier.shared
try mobileCredentialVerifier
.initialize(
loggerConfiguration: loggerConfiguration
)
} catch {
print(error)
}
}
logLevel
: Determines which events are written to log files:callbackLogLevel
: Determines which events invoke thecallback
function:callback
: Defines the function to call when events defined bycallbackLogLevel
occur.
Logging levels
These levels apply to both the logLevel
and callbackLogLevel
parameters (corresponding raw value
in shown in parenthesis):
- Off (0).
- Error (1).
- Warning (2).
- Info (3).
- Debug (4).
- Verbose (5).
Last updated on