Troubleshooting

View this page for | |

To facilitate troubleshooting and debugging, you can activate the SDK logging feature.

For iOS/macOS, the logging functionality leverages Apple OSLog.

Logs can also be generated in a log file located in the application bundle.

Note: It is recommended that you enable logging only for debug builds of the integrating application.

The SDK logging feature is activated according to the configuration of the application preferences.

Optionally, you can define the following keys:

  • HID_PREFKEY_LOG_LEVEL

    This key controls SDK logging behavior (disabled or enabled). It also controls the log level (log verbosity) of the SDK when logging is enabled.

    For instructions on viewing the Apple OSLog messages, go to the Apple documentation.

    The possible values are (in descending order of severity):

    • HID_PREFVALUE_LOG_LEVEL_ERROR

    • HID_PREFVALUE_LOG_LEVEL_INFO

    • HID_PREFVALUE_LOG_LEVEL_VERBOSE

    • HID_PREFVALUE_LOG_LEVEL_OFF (logs are disabled – default value)

  • HID_PREFKEY_LOG_LOGFILEPATH

    When SDK logs are enabled, this key controls if the log should also be redirected to a log file located in the application bundle.

    The string value can contain NSSearchPathDirectory enum by using the percentage % character (for example, NSCachesDirectory%/Logs.txt).

    When this key is not present, no log file will be created.

Sample iOS/macOS Log Configuration (Swift)

Copy
// Enable troubleshooting logs only in debug

#if DEBUG
// Configure HID Approve SDK logs by setting appropriate application preferences
NSUserDefaults* defaultsPrefs = [NSUserDefaults standardUserDefaults];
// Configure HID Approve SDK logs to log with OSLog only ERROR messages 
[defaultsPrefs setValue:HID_PREFVALUE_LOG_LEVEL_ERROR forKey:HID_PREFKEY_LOG_LEVEL];
// Optionally configure HID Approve SDK logs to additionally log into a log file
//[defaultsPrefs setValue:HID_PREFVALUE_LOG_LOGFILEPATH_SUPPORTDIR forKey:HID_PREFKEY_LOG_LOGFILEPATH];

#endif

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.