prepareDatabase method

Future<SuccessOrError> prepareDatabase(
  1. String databaseID,
  2. DocumentReaderPrepareCompletion prepareCompletion
)

Allows you to download a database from the Regula server. If it exists in your app and compatible with the SDK, it won't be downloaded.

databaseID - identifier of the database.

prepareCompletion - callback that returns downloading progress.

Check out SuccessOrError documentation for handling return type.

Requires android.permission.INTERNET android permission.

Implementation

Future<SuccessOrError> prepareDatabase(
  String databaseID,
  DocumentReaderPrepareCompletion prepareCompletion,
) async {
  _setDocumentReaderPrepareCompletion(prepareCompletion);
  var response = await _bridge.invokeMethod("prepareDatabase", [databaseID]);
  return _successOrErrorFromJson(response);
}