Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Page Properties
hiddentrue

Status

Status
colourGreen
titleapproved

Approver

Alpar Szotyori (Unlicensed)

Info

We recommend using Capture Flow with Fragments instead of activities.

In order to use the capture flow with activities, follow these steps:

  1. Request camera access.

  2. Configure the capture feature using the CaptureConfiguration.

  3. Register an activity result handler with the CaptureFlowContract().

  4. Launch the SDK with GiniBank.startCaptureFlow().

  5. Handle the extraction results (e.g. in the registerForActivityResult).

  6. Send the final transfer summary values to Gini by calling GiniBank.sendTransferSummary()method which will be used to improve the future extraction accuracy

  7. Clean up the SDK by calling GiniBank.releaseCapture() while also providing the required extraction feedback to improve future extraction accuracy. which will release the resources used by SDK.

Follow these recommendations:

Note
  • Provide values for all necessary fields, including those that were not extracted.

  • Provide the final data approved by the user (and not the initially extracted only).

  • Do cleanup Send transfer summary only after TAN verification.

...

Drawio
mVer2
zoom1
simple0
inComment0
custContentId2884089
pageId2949214
lbox1
diagramDisplayNameUntitled Diagram-1675761818164.drawio
contentVer67
revision67
baseUrlhttps://gini.atlassian.net/wiki
diagramNameUntitled Diagram-1675761818164.drawio
pCenter0
width860
links
tbstyle
height379.5
Info

Check out an example app to see how an integration can look like.

...

  • CaptureResult.Success

A document was analyzed analysed and the extractions are available in the properties of the CaptureResult.Success object.

...

Code Block
languagekotlin
// Use the androidx's Activity Result API to register a handler for the capture result.
val captureLauncher = registerForActivityResult(CaptureFlowContract()) { result: CaptureResult ->
    when (result) {
        is CaptureResult.Success -> {
            handleExtractionsshowExtractions(result.specificExtractions)
        }
        is CaptureResult.Error -> {
            when (result.value) {
                is ResultError.Capture -> {
                    val captureError: GiniCaptureError = (result.value as ResultError.Capture).giniCaptureError
                    handleCaptureError(captureError)
                }
                is ResultError.FileImport -> {
                    // See the File Import section on the Capture Features page for more details.
                    val fileImportError = result.value as ResultError.FileImport
                    handleFileImportError(fileImportError)
                }
            }
            GiniBank.releaseCapture(this)
        }
       this, "",
  CaptureResult.Empty -> {
            handleNoExtractions()
 "", "", "", "", Amount.EMPTY             GiniBank.releaseCapture(this)
        }
        CaptureResult.EmptyCancel -> {
            handleNoExtractionshandleCancellation()
            GiniBank.releaseCapture(this)
        }
       this, "",
  CaptureResult.EnterManually -> {
              "", "", "", "", Amount.EMPTYhandleEnterManually()
              GiniBank.releaseCapture(this)
        }
    }
}

 CaptureResult.Cancel -> fun startGiniBankSDK() {
    // Make sure camera permission has been already handleCancellation()granted at this point.

    // Instantiate the networking GiniBankimplementation.releaseCapture(
    val networkService: GiniCaptureNetworkService  = ...

    // this, "",
 Configure the capture feature.
    GiniBank.setCaptureConfiguration(
        CaptureConfiguration(
"", "", "", "", Amount.EMPTY        networkService = networkService,
  )         } ...
       CaptureResult.EnterManually ->)
{    )

    // Launch and handleEnterManually()wait for the    result.
      GiniBank.releaseCapturestartCaptureFlow(captureLauncher)
}

fun              this, "",stopGiniBankSDKWithTransferSummary(paymentRecipient: String, 
                "", "", "", "", Amount.EMPTY             )      paymentReference: String,
 }     } }  fun launchGiniCapture() {     // Make sure camera permission has been already granted at this point.      // Check that the device fulfills the requirements.paymentPurpose: String, 
   val report = GiniCaptureRequirements.checkRequirements((Context) this)     if (!report.isFulfilled()) {         handleUnfulfilledRequirements(report)         return     }      // Instantiate the networking implementation.
    val networkService: GiniCaptureNetworkService  = ...iban: String,
        // Configure the capture feature.     GiniBank.setCaptureConfiguration(         CaptureConfiguration(             networkService = networkServicebic: String,
            ...         )     )      // Launch and wait for the result.     GiniBank.startCaptureFlow(captureLauncher)
}

void stopGiniBankSDK(amount: Amount
  ) {
    // After the user has seen and potentially corrected the extractions, send the final
 // cleanup the SDK// while passing in the final extraction transfer summary values to    //Gini which will be used as feedback to improve the future extraction accuracy:
    GiniBank.releaseCapturesendTransferSummary(this,
            paymentRecipient,
            paymentReference,
            paymentPurpose,
            iban,
            bic,
            amount
            )
            
    // cleanup the capture SDK after sending the transfer summary
    GiniBank.releaseCapture(this)
}