Customer Support Integration
The Entrupy Android SDK provides built-in customer support features through its UI components. Flagging, structured communications and retake workflows are available in the SDK's Detail View Controller. To flag results from your own screens, use getFlagDetails and setFlag, described in section 2.
Overview
The SDK's support model works as follows:
- Flag management is available in the Detail View, where users can flag results and see flag status updates. You can also build your own flag UI with
getFlagDetailsandsetFlag. - Structured communications (support messages) are managed through the Detail View's per-item support interface.
- Retake requests are initiated through the SDK when Entrupy's review team determines additional images are needed.
1. Detail View as the Support Hub
The Detail View Controller is the primary interface for item-specific support. Launch it with displayDetailViewForItem():
import com.entrupy.sdk.app.EntrupyApp
fun showSupportForItem(entrupyId: String) {
val entrupyApp = EntrupyApp.sharedInstance()
if (entrupyApp.isAuthorizationValid()) {
entrupyApp.displayDetailViewForItem(entrupyId)
} else {
Log.e("Support", "User not authorized. Please log in again.")
}
}
Within the Detail View, users can:
- View the authentication result and status.
- Flag a result for review (if eligible).
- Access item-specific support communication.
- Initiate retakes when requested by Entrupy.
2. Flagging From Your Own UI
If you build your own result screens, use getFlagDetails and setFlag to flag a result or clear its flag. They match iOS getFlagDetailsForResult and setFlag.
Get the Flag Details
getFlagDetails returns the item's flag state and the reasons a user can pick from. The reasons come from the SDK configuration. If no prefetch has loaded it yet, the SDK loads it first.
import com.entrupy.sdk.app.EntrupyApp
import com.entrupy.sdk.listeners.FlagDetailsCallback
import com.entrupy.sdk.model.EntrupyFlagDetails
EntrupyApp.sharedInstance().getFlagDetails(
entrupyId = "T8GV7QKJ",
callback = object : FlagDetailsCallback {
override fun onFlagDetailsFetched(details: EntrupyFlagDetails) {
when {
details.canFlag -> showReasonPicker(details.supportedFlagReasons)
details.flagStatus.isFlagged -> showClearFlagButton()
else -> hideFlagActions()
}
}
override fun onFlagDetailsError(errorCode: Int, description: String) {
Log.e("Flag", "Could not load flag details ($errorCode): $description")
}
},
)
EntrupyFlagDetails (com.entrupy.sdk.model):
| Property | Type | Description |
|---|---|---|
flagStatus | EntrupyCaptureResult.Status.Flag | The current flag state: id, isFlaggable, isFlagged and flagInfo |
supportedFlagReasons | List<EntrupyFlagReason> | The reasons for this item's category, plus the generic ones |
canFlag | Boolean | true when the item is flaggable and not already flagged |
Some items have no reasons. When canFlag is true and supportedFlagReasons is empty, flag the item without a reasonId, as on iOS.
EntrupyFlagReason:
| Property | Type | Description |
|---|---|---|
id | String | Pass it to setFlag as reasonId |
label | String | The text to show the user |
isMessageRequired | Boolean | true when this reason needs a note, which the backend sets per reason. iOS does not expose this field |
Flag a Result
Pass flag = true and a reasonId from supportedFlagReasons. Leave reasonId out when the list is empty. Pass a message when the reason requires one.
import com.entrupy.sdk.listeners.SetFlagCallback
EntrupyApp.sharedInstance().setFlag(
flag = true,
entrupyId = "T8GV7QKJ",
reasonId = selectedReason.id,
message = note,
callback = object : SetFlagCallback {
override fun onFlagSet(entrupyId: String, flag: Boolean) {
refreshItem(entrupyId)
}
override fun onSetFlagError(
entrupyId: String,
flag: Boolean,
errorCode: Int,
description: String,
) {
Log.e("Flag", "Could not flag $entrupyId ($errorCode): $description")
}
},
)
onSetFlagError gets the Entrupy ID and the flag you passed, so one callback can serve a whole list, as with iOS's flag delegate.
An empty Entrupy ID is rejected before any request. Then the SDK fetches the item, and loads the configuration if needed, before it sends the flag. It does not send the flag when:
- the item is already flagged or cannot be flagged:
FLAG_NOT_ALLOWED(2006). - the item has reasons and
reasonIdis missing or not one of them, or the reason requires a message and none was given:BAD_REQUEST(400).
Clear a Flag
Pass flag = false. No reason or message is needed.
EntrupyApp.sharedInstance().setFlag(
flag = false,
entrupyId = "T8GV7QKJ",
callback = setFlagCallback,
)
Errors
Both methods need a logged-in user. Callbacks run on the main thread. The one exception is SDK_NOT_INITIALIZED, which is reported right away on the calling thread.
| Code | When |
|---|---|
SDK_NOT_INITIALIZED (2002) | EntrupyApp.init was not called |
UNAUTHORIZED_ACCESS (401) | The user is not logged in |
FORBIDDEN (403) | The session ended, or the Entrupy ID is unknown or belongs to another account |
BAD_REQUEST (400) | Invalid input, as described above |
FLAG_NOT_ALLOWED (2006) | The item is already flagged or cannot be flagged |
CONFIGURATION_FETCH_ERROR (2003) | The configuration with the reasons could not be loaded |
UNKNOWN_ERROR (0) | The device is offline, the request timed out, the item has no flag state, or the backend did not confirm the change |
Other HTTP failures, such as TOO_MANY_REQUESTS (429) or SERVICE_UNAVAILABLE (503), are reported as in fetchSessionDetails. The description carries the backend's message when it sent one.
Search results already carry status.flag.isFlaggable and status.flag.isFlagged. Use them to decide whether to show "Flag Result" or "Clear Flag" in a list, and call getFlagDetails only when the user opens the flag screen.
3. Backend Notifications via Webhooks
For server-side tracking of flag status changes and support interactions, configure webhooks on your backend:
- Flag status changes: Receive notifications when flags are set, resolved, or updated.
- Result updates: Get notified when authentication results change after a review.
- Retake requests: Learn when Entrupy determines additional images are needed.
Refer to Essential Backend Integration Tasks for webhook setup.
4. Retake Capture
When Entrupy's support team requests additional images, you can launch the retake capture flow:
import com.entrupy.sdk.app.EntrupyApp
fun handleRetakeRequest(authenticationId: String) {
EntrupyApp.sharedInstance().startRetakeCapture(authenticationId)
}
See the Retake Flow UI guide for details.
Best Practices
- Guide users to the Detail View for support. The SDK's built-in UI provides a maintained, consistent support experience.
- With your own flag UI, use the reasons from
getFlagDetails. Do not hard-code reason ids. They come from the SDK configuration and can change. - Monitor support events via webhooks. Configure your backend to receive flag and result update notifications.
- Perform UI updates on the main thread. If handling webhook-driven updates in your app, dispatch UI changes accordingly.
Next Steps
- Review the Detail View Controller guide to see how support features are presented.
- Learn about the Retake Flow UI for handling retake requests.
- Explore Handling Result Flags for the flag lifecycle.