public interface GiniCaptureNetworkService
The easiest way to get started is to use the Gini Capture Network Library package which provides a default implementation.
You can also create your own implementation and communicate directly with the Gini API or pass requests through your backend. For direct communication with the Gini API we recommend using the Gini Pay API lib.
In order for the Gini Capture SDK to use your implementation pass an instance of it to
GiniCapture.Builder#setGiniCaptureNetworkService(GiniCaptureNetworkService)
when creating a
GiniCapture
instance.
When an instance of this interface is available document analysis related methods in the
CameraFragmentListener
, ReviewFragmentListener
and the AnalysisFragmentListener
won't be invoked. Otherwise the Gini Capture SDK falls back to
invoking those methods.
Modifier and Type | Method and Description |
---|---|
CancellationToken |
analyze(java.util.LinkedHashMap giniApiDocumentIdRotationMap,
GiniCaptureNetworkCallback callback)
Called when a document needs to be analyzed by the Gini API.
|
void |
cleanup()
Called when the Gini Capture SDK is not needed anymore and the
GiniCapture#cleanup(Context) method has been called. |
CancellationToken |
delete(java.lang.String giniApiDocumentId,
GiniCaptureNetworkCallback callback)
Called when a document needs to be deleted from the Gini API.
|
default void |
handleErrorLog(ErrorLog errorLog) |
CancellationToken |
upload(Document document,
GiniCaptureNetworkCallback callback)
Called when a document needs to be uploaded to the Gini API.
|
CancellationToken upload(Document document, GiniCaptureNetworkCallback callback)
You should only upload the document. Polling or retrieving extractions is not needed at this point.
document
- a Document
containing an image, pdf or other supported formatscallback
- a callback implementation to return the outcome of the uploadCancellationToken
to be used for requesting upload cancellationCancellationToken delete(java.lang.String giniApiDocumentId, GiniCaptureNetworkCallback callback)
giniApiDocumentId
- id of the document received when it was uploaded to the Gini APIcallback
- a callback implementation to return the outcome of the deletionCancellationToken
to be used for requesting cancellation of the deletionCancellationToken analyze(java.util.LinkedHashMap giniApiDocumentIdRotationMap, GiniCaptureNetworkCallback callback)
The documents were already uploaded and only the Gini API document ids of documents are passed in along with the user applied document rotations.
giniApiDocumentIdRotationMap
- a map of Gini API document ids and the user applied
document rotationscallback
- a callback implementation to return the outcome of the
analysisCancellationToken
to be used for requesting analysis cancellationvoid cleanup()
GiniCapture#cleanup(Context)
method has been called.
Free up any resources your implementation is using.
default void handleErrorLog(ErrorLog errorLog)