Troubleshooting
To facilitate troubleshooting and debugging, you can activate the SDK logging feature.
The SDK logging feature is activated according to the configuration of the application preferences.
Optionally, you can define the following keys:
HIDGlobal.ActivIDMobileSDK.Logging.Enabled
- Set the boolean value to "Yes" to enable logging to a file
- Set the boolean value to "No" to disable logging (default)
HIDGlobal.ActivIDMobileSDK.Logging.Level
-
String value defining the logging level of the application when logging is enabled
-
The possible levels are (in descending order of severity):
-
ERROR (error events)
-
INFO (useful information)
-
VERBOSE (useful events during software debugging when more granular information is needed)
-
-
If the key is missing, or not defined with one of above values, the default level is INFO
HIDGlobal.ActivIDMobileSDK.Logging.XcodeConsoleEnabled
-
Set the boolean value to "True" to enable logging in the Xcode IDE console (for live debugging) as well as logging to a file - requires that HIDGlobal.ActivIDMobileSDK.Logging.Enabled is set to "True"
-
Set the boolean value to "False" to disable logging in the Xcode console (default)
HIDGlobal.ActivIDMobileSDK.Logging.LogFile
- String value containing the logging filename using the relative path to the application sandbox directory
- The string value may contain NSSearchPathDirectory enum by using percent sign (for example, %NSCachesDirectory%/Logs.txt)
- The default value when logging is enabled is %NSApplicationSupportDirectory%/ActivIdLogs.txt
// Enable troubleshooting logs only in debug
do {
try FileManager.default.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
} catch {
printf("Create dir failed")
}
UserDefaults.standard.set("%NSApplicationSupportDirectory%/Logs.txt", forKey:"HIDGlobal.ActivIDMobileSDK.Logging.LogFile")
#if DEBUG
UserDefaults.standard.set(true, forKey:"HIDGlobal.ActivIDMobileSDK.Logging.Enabled")
#else
UserDefaults.standard.set(false, forKey:"HIDGlobal.ActivIDMobileSDK.Logging.Enabled")
#endif
UserDefaults.standard.set("VERBOSE", forKey:"HIDGlobal.ActivIDMobileSDK.Logging.Level")
Error Codes
The following error codes might be returned by the SDK.
Internal Errors
Error Code | Description |
---|---|
(0) Internal |
An unexpected error occurred |
(1) NotImplemented |
The method is not implemented |
(2) UnsupportedOperation |
The operation is not supported by the object |
(3) InvalidArgument |
The given parameter is not valid or required |
(4) KeyGenerationFailure |
Unable to generate internal credential |
(5) ProtectionPolicyFailure |
Unable to create or locate internal protection policy |
(6) SecureDataFailure |
Unable to create or locate internal credential data |
(7) UnsupportedVersion | Container version is not supported and cannot be upgraded |
(8) InvalidContainer | Container identifier is invalid or does not exist |
(9) InexplicitContainer | Container is ambiguous and cannot be explicitly determined |
Credential Errors
Error Code | Description |
---|---|
(100) Authentication |
Authentication failed |
(101) InvalidPassword |
The password fails policy requirements |
(102) CredentialsExpired |
The credentials used to sign the transaction have expired |
(103) PasswordExpired |
The password has expired and requires a change of password Thrown by retrieveTransaction and setStatus when currentAge is greater or equal than maxAge. |
(104) PasswordNotYetUpdatable |
The password cannot be changed yet Thrown by change password when currentAge is less than minAge. |
(105) PasswordRequired |
The required password was not provided |
(106) LostCredentials |
The provisioning key securing the transaction has been wiped. Most probably due to an update of the device's policy. A new provisioning operation is required. |
(107) InvalidChallengeTooLong |
The challenge is too long with respect to the OTP configuration |
(108) InvalidChallengeBadFormat |
The challenge does not have the format expected by the OTP configuration |
(109) PasswordCancelled |
The password event has been canceled by the user |
Device Errors
Error Code | Description |
---|---|
(200) UnsupportedDevice |
The device configuration is not supported This exception can be returned if a given device is not supported by policy or does not have the minimum required security configuration. |
(201) UnsafeDevice |
The device is not safe enough to store sensitive secrets For example, starting from LOLLIPOP, provisioning operation are forbidden if the mobile is not protected by a password. |
(202) FingerprintNotEnrolled | Fingerprints have not been enrolled |
(203) UserCancelled | The user has canceled the operation |
(204) FingerprintAuthenticationRequired | Authentication with fingerprint is required to perform the operation |
(205) UnsupportedOperationMode | Mode of operation required by the server is not supported by the device |
(206) GooglePlayServicesObsolete | Google Play services is not up to date |
(207) BiometricAuthenticationNotEnabled | Enabling biometric authentication is required to perform the operation |
Communication Errors
Error Code | Description |
---|---|
(300) ServerAuthentication | Authentication to the server failed |
(301) ServerVersion | The server protocol version is not supported by the client |
(302) ServerProtocol |
An unexpected failure has occurred in the implementation layer The server sent a message not compliant with the protocol version. |
(303) Remote | Execution of a remote method call failed |
(304) ServerUnsupportedOperation | The server does not support the requested operation |
(305) ServerOperationFailed | The server was not able to execute the requested operation |
(306) ServerCustomizationInvalid | The server's mobile-app customization package is invalid or contains an invalid data |
Transaction Errors
Error Code | Description |
---|---|
(1000) TransactionExpired | The transaction has expired |
(1001) TransactionContainerInvalid |
The transaction id refers to a container that does not exist It might happen if the container is deleted locally without notifying the server. |