Implement Android event listeners
Last updated: October 28, 2024
To implement a streamlined and successful user journey you must:
-
Implement the iProov event listener interface.
-
Register the listener with the activity.
Examples
See the implementation examples: https://github.com/iProov/android#register-a-listener
SDK claim lifecycle
The diagram below maps the possible events during an iProov Android SDK claim transaction. .
Events
Event | Description | Implementation guidance | Suggested user experience |
---|---|---|---|
onConnecting
|
The SDK is connecting to the iProov server. |
Recommended debug logging. | Depending on the journey, display a loading or progress indicator. |
onConnected
|
The SDK is connected and the iProov UI launches. | Recommended debug logging. | Hide the progress indicators. The iProov UI displays automatically. |
onProcessing
|
The claim is being processed and video streamed to complete the user authentication. |
|
Display a progress indicator. Descriptive messages are provided by iProov. |
onSuccess
|
The iProov claim was completed successfully. | You must call the validate endpoint to validate this token. See the Verify enrolled users API. |
|
onFailure
|
The claim was processed resulting in a failure code. May indicate a fraudulent attempt. | Review the failure codes. Some codes will indicate a valid retry attempt with appropriate user guidance. Others will indicate that the GPA or LA claim has been rejected. |
Depending on the failure code:
|
onError
|
iProov was unable to process the claim. There was a system failure establishing a connection or capture, or during the processing. The error reason is provided by iProov. |
Log as an error. If the error occurred in the allowed number of retry attempts:
|
|
onCancelled
|
The user canceled the process by tapping Back. | Log the incomplete user journey including the retry attempt number. |
Offer a retry attempt and provide guidance for completing a claim. See: Unhappy path |
Android lifecycle events
Event | Description | Implementation guidance |
---|---|---|
onCreate
|
Activity |
You must register this activity as the iProov listener. |
onDestroy
|
Activity onDestroy override. |
iProov strongly recommends unregistering the listener. See: Android cleanup |
Register the listener
Before launching the iProov SDK you must implement the interface and register the event listener. See this example: https://github.com/iProov/android#register-a-listener
Register the listener in the onCreate()
method.
If you do not register the listener before launching the SDK, an exception will be thrown.
Next step