A. Managing Authentication Results
After an item is successfully submitted through the Entrupy SDK's capture flow (as handled by the didCaptureCompleteSuccessfully
delegate), the journey of an authentication is not yet complete. The initial callback provides confirmation of submission and may include an Estimated Time of Arrival (ETA) or a preliminary status. The definitive authentication result (e.g., Authentic, Unidentified) is determined by Entrupy's backend systems.
This guide provides an overview of how to think about these results and introduces concepts that will be further detailed in the SDK Reference, particularly concerning the Detail View.
1. Understanding the Result Lifecycle
-
Initial Submission Confirmation: The
didCaptureCompleteSuccessfully
delegate method is your first indication that the item's data and images have been received by Entrupy. Theresult
dictionary passed to this method is important. It often contains:- A unique Entrupy ID for the transaction.
- Initial status information, which could be an ETA for the final result (e.g., "Processing, ETA: 10 minutes").
- Echoed item metadata that you provided.
You should store the Entrupy ID, associating it with your
customer_item_id
, to track the authentication status. -
Asynchronous Result Delivery: The final authentication result is typically delivered asynchronously.
- Webhooks (Recommended for Backend): The most robust way to receive final results is by configuring webhooks from the Entrupy API to your backend server. Your backend can then update your system of record and notify your app as needed.
- API Polling/Refreshing: Making direct requests to the Entrupy API to recieve results is also an option if webhooks are not a fit for your deployment.
- SDK Polling/Refreshing: The SDK provides mechanisms to refresh or fetch the latest status of a submission, often used when displaying a list of authentications or a specific item's detail view.
-
Interpreting the Final Result: The final result will categorize the item (e.g., Authentic, Unidentified, Not Supported, Invalid). Along with this primary result, you may also receive:
- Certificate Information: For authentic items, a link to a digital certificate of authenticity.
- Flags: Information about any issues or flags raised on the item (see Handling Result Flags).
- Catalog Data: Rich product information, condition details, and potentially market data (see Understanding Catalog Data in SDK).
- Event Timeline: A history of events related to the authentication.
2. Key Identifiers
When managing results, keep track of these important identifiers:
customer_item_id
: Your internal unique identifier for the item. This is important for correlating Entrupy's results with your own inventory or records.- Entrupy ID: The unique ID generated by Entrupy for each authentication attempt. This is used when querying the API or SDK for updates, viewing an item's certificate or when referencing a specific authentication with Entrupy support.
3. Displaying Results
Once you have an Entrupy ID, you can use it to launch or present the SDK's Detail View for that specific item. This view is designed to show:
- The final authentication result.
- ETAs if the result is still pending.
- Flags associated with the item.
- Relevant Catalog Data.
- Certificate access.
Presenting the Detail View
Use the Entrupy ID to present the SDK's Detail View for an item via displayDetailViewForItemWithEntrupyID:withConfiguration:
. Configure the view with EntrupyDetailViewConfiguration
.
// Swift
import EntrupySDK
// Conform to EntrupyDetailViewDelegate to receive lifecycle callbacks
class ResultsViewController: UIViewController, EntrupyDetailViewDelegate {
func showEntrupyDetailView(for entrupyId: String) {
guard EntrupyApp.sharedInstance().isAuthorizationValid() else {
print("User not authorized. Please log in first.")
return
}
// Configure which sections and actions to display inside the SDK Detail View
let viewConfig = EntrupyDetailViewConfiguration(
displayTimeline: true,
displayUploadedImages: true,
enableFlagging: true,
enableItemDetailEdit: false
)
// Assign the delegate to receive presentation/dismissal callbacks
EntrupyApp.sharedInstance().detailViewDelegate = self
// Present the SDK Detail View for the given Entrupy ID
EntrupyApp.sharedInstance().displayDetailViewForItem(
withEntrupyID: entrupyId,
withConfiguration: viewConfig
)
}
// MARK: EntrupyDetailViewDelegate
func didDisplayDetailViewForItemWithEntrupyID(_ entrupyID: String) {
print("Detail View presented for: \(entrupyID)")
}
func didDismissDetailViewForItemWithEntrupyID(_ entrupyID: String) {
print("Detail View dismissed for: \(entrupyID)")
}
func didDisplayDetailViewFailWithError(_ errorCode: EntrupyErrorCode, description: String, localizedDescription: String, forEntrupyID entrupyID: String) {
print("Failed to display Detail View for \(entrupyID): \(localizedDescription) [\(errorCode)]")
}
}
// Example usage (after obtaining an Entrupy ID):
// ResultsViewController().showEntrupyDetailView(for: "E-1234567890")
Configuration options in EntrupyDetailViewConfiguration
:
- displayTimeline: Bool — show the event timeline section
- displayUploadedImages: Bool — show uploaded capture images
- enableFlagging: Bool — allow flagging/clearing flags on the result
- enableItemDetailEdit: Bool — allow editing item details (if enabled for your account)
For more details on the Detail View's capabilities and UI, see sdk-reference/view-model-guides/detail-view-controller.md
.
4. Next Steps
- Learn how to manage issues reported on results: Handling Result Flags
- Understand how to search for past authentications within the SDK: Searching SDK Authentications
- Prepare to dive deeper into the UI components for displaying full results by reviewing plans for the Detail View Controller (once created).