Skip to content

Commit

Permalink
Final commit for 4.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JumioMobileTeam committed Apr 26, 2023
1 parent 1f8d3bf commit 98c0f52
Show file tree
Hide file tree
Showing 57 changed files with 599 additions and 113 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 4.5.0
* Updated Jumio SDK Android and iOS to 4.5.0
* Update dependencies to Flutter 3.7.11 and Dart 2.19.6

## 4.4.0
* Updated Jumio SDK Android to 4.4.1 and iOS to 4.4.0
* Update dependencies to Flutter 3.3.10 and Dart 2.18.6
Expand Down
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Official Jumio Mobile SDK plugin for Flutter

This plugin is compatible with version 4.4.0 of the Jumio SDK (4.4.0 for iOS, 4.4.1 for Android). If you have questions, please reach out to your Account Manager or contact [Jumio Support](#support).
This plugin is compatible with version 4.5.0 of the Jumio SDK. If you have questions, please reach out to your Account Manager or contact [Jumio Support](#support).

# Table of Contents
- [Compatibility](#compatibility)
Expand All @@ -24,7 +24,7 @@ This plugin is compatible with version 4.4.0 of the Jumio SDK (4.4.0 for iOS, 4.
- [Support](#support)

## Compatibility
Compatibility has been tested with a Flutter version of 3.3.10 and Dart 2.18.6
Compatibility has been tested with a Flutter version of 3.7.11 and Dart 2.19.6

## Setup
Create Flutter project and add the Jumio Mobile SDK module to it.
Expand All @@ -40,7 +40,7 @@ dependencies:
flutter:
sdk: flutter

jumio_mobile_sdk_flutter: ^4.4.0
jumio_mobile_sdk_flutter: ^4.5.0
```

And install the dependency:
Expand Down Expand Up @@ -74,7 +74,7 @@ Make sure your compileSdkVersion, minSdkVersion and buildToolsVersion are high e
```groovy
android {
minSdkVersion 21
compileSdkVersion 31
compileSdkVersion 33
buildToolsVersion "32.0.0"
...
}
Expand Down Expand Up @@ -201,7 +201,6 @@ You can pass the following customization options at [`Jumio.start`](example/lib/
| scanViewBubbleForeground |
| scanViewBubbleBackground |
| scanViewForeground |
| scanViewAnimationBackground |
| scanViewAnimationShutter |
| searchBubbleBackground |
| searchBubbleForeground |
Expand Down Expand Up @@ -280,6 +279,20 @@ JumioSDK will return `EventResult` in case of a successfully completed workflow
| personalNumberValid | BOOL | | True if personal number check digit is valid or not available, otherwise false |
| compositeValid | BOOL | | True if composite check digit is valid, otherwise false |

## Local Models for JumioDocfinder

If you are using our JumioDocFinder module, you can download our encrypted models and add them to your bundle from [here](https://cdn.mobile.jumio.ai/model/classifier_on_device_ep_99_float16_quant.enc) and [here](https://cdn.mobile.jumio.ai/model/normalized_ensemble_passports_v2_float16_quant.enc).

We recommend to download the files and add them to your project without changing their names (the same way you add Localization files). This will save two network requests on runtime to download these files.

### iOS

You also need to copy those files to the "ios/Assets" folder for Flutter to recognize them.

### Android

You need to copy those files to the assets folder of your Android project (Path: "app/src/main/assets/")

## FAQ

### iOS Runs on Debug, Crashes on Release Build
Expand Down
13 changes: 6 additions & 7 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 32
compileSdkVersion 33

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -51,26 +51,25 @@ android {
}

ext {
SDK_VERSION = "4.4.1"
SDK_VERSION = "4.5.0"
}

dependencies {
// Jumio dependencies
implementation "com.jumio.android:core:${SDK_VERSION}"
implementation "com.jumio.android:linefinder:${SDK_VERSION}"
// Flutter can't properly handle results after activity restarts caused by Docfinder module
//implementation "com.jumio.android:docfinder:${SDK_VERSION}"
implementation "com.jumio.android:docfinder:${SDK_VERSION}"
implementation "com.jumio.android:mrz:${SDK_VERSION}"
implementation "com.jumio.android:nfc:${SDK_VERSION}"
implementation "com.jumio.android:barcode:${SDK_VERSION}"
implementation "com.jumio.android:barcode-mlkit:${SDK_VERSION}"
implementation "com.jumio.android:iproov:${SDK_VERSION}"
implementation "com.jumio.android:defaultui:${SDK_VERSION}"
implementation "com.jumio.android:datadog:${SDK_VERSION}"
implementation "com.iproov.sdk:iproov:8.1.0"
implementation "com.jumio.android:digital-identity:${SDK_VERSION}"

//only for the sample code
implementation "androidx.activity:activity-ktx:1.4.0"
implementation "androidx.activity:activity-ktx:1.5.1"

//Kotlin
implementation "androidx.multidex:multidex:2.0.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.jumio.jumiomobilesdk

import android.content.Intent
import androidx.annotation.NonNull
import io.flutter.embedding.engine.plugins.FlutterPlugin
import io.flutter.embedding.engine.plugins.activity.ActivityAware
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding
Expand All @@ -10,7 +9,6 @@ import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import io.flutter.plugin.common.MethodChannel.Result
import io.flutter.plugin.common.PluginRegistry
import io.flutter.plugin.common.PluginRegistry.Registrar

class JumioMobileSdkPlugin : FlutterPlugin, MethodCallHandler, ActivityAware, PluginRegistry.ActivityResultListener, PluginRegistry.RequestPermissionsResultListener {
companion object{
Expand All @@ -20,15 +18,15 @@ class JumioMobileSdkPlugin : FlutterPlugin, MethodCallHandler, ActivityAware, Pl
private lateinit var channel: MethodChannel

private val modules: List<JumioMobileSdkModule> = listOf(
JumioModule()
JumioModule()
)

override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
channel = MethodChannel(flutterPluginBinding.binaryMessenger, CHANNEL_NAME)
channel.setMethodCallHandler(this)
}

override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) {
override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
channel.setMethodCallHandler(null)
}

Expand All @@ -50,7 +48,7 @@ class JumioMobileSdkPlugin : FlutterPlugin, MethodCallHandler, ActivityAware, Pl

override fun onDetachedFromActivity() {}

override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
override fun onMethodCall(call: MethodCall, result: Result) {
modules.filter { it.handlesMethod(call.method) }.forEach { it.handleMethodCall(call, result) }
}

Expand Down
24 changes: 15 additions & 9 deletions android/src/main/kotlin/com/jumio/jumiomobilesdk/JumioModule.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.jumio.jumiomobilesdk

import android.content.Intent
import android.os.Build
import com.jumio.defaultui.JumioActivity
import com.jumio.sdk.credentials.JumioCredentialCategory.FACE
import com.jumio.sdk.credentials.JumioCredentialCategory.ID
Expand All @@ -26,10 +27,15 @@ class JumioModule : ModuleBase() {

override fun handleActivityResult(requestCode: Int, resultCode: Int, data: Intent?): Boolean {
return if (requestCode == REQUEST_CODE) {
if (data != null) {
val jumioResult = data.getSerializableExtra(JumioActivity.EXTRA_RESULT) as JumioResult
data?.let {
val jumioResult = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
it.getSerializableExtra(JumioActivity.EXTRA_RESULT, JumioResult::class.java)
} else {
@Suppress("DEPRECATION")
it.getSerializableExtra(JumioActivity.EXTRA_RESULT) as JumioResult?
}

if (jumioResult.isSuccess) sendScanResult(jumioResult) else sendCancelResult(jumioResult)
if (jumioResult?.isSuccess == true) sendScanResult(jumioResult) else sendCancelResult(jumioResult)
}
true
} else {
Expand Down Expand Up @@ -69,10 +75,10 @@ class JumioModule : ModuleBase() {
ensurePermissionsAndRun()
}

private fun sendScanResult(jumioResult: JumioResult) {
val accountId = jumioResult.accountId
val credentialInfoList = jumioResult.credentialInfos
val workflowId = jumioResult.workflowExecutionId
private fun sendScanResult(jumioResult: JumioResult?) {
val accountId = jumioResult?.accountId
val credentialInfoList = jumioResult?.credentialInfos
val workflowId = jumioResult?.workflowExecutionId

val result = mutableMapOf<String, Any?>(
"accountId" to accountId,
Expand Down Expand Up @@ -139,8 +145,8 @@ class JumioModule : ModuleBase() {
sendResult(result)
}

private fun sendCancelResult(jumioResult: JumioResult) {
if (jumioResult.error != null) {
private fun sendCancelResult(jumioResult: JumioResult?) {
if (jumioResult?.error != null) {
val errorMessage = jumioResult.error?.message ?: ""
val errorCode = jumioResult.error?.code ?: ""
sendResult(
Expand Down
4 changes: 2 additions & 2 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 32
compileSdkVersion 33

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -40,7 +40,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.jumio.jumiomobilesdk_example"
minSdkVersion 21
targetSdkVersion 31
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
Expand Down
17 changes: 17 additions & 0 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.jumio.jumiomobilesdk_example">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
Expand Down Expand Up @@ -40,6 +41,22 @@
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name="com.jumio.defaultui.JumioActivity"
android:exported="true"
android:launchMode="singleTask"
tools:replace="android:exported">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="jumio-di-redirect"
android:scheme="app" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
Expand Down
Binary file not shown.
Binary file not shown.
44 changes: 20 additions & 24 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
PODS:
- DatadogSDK (1.11.1)
- Flutter (1.0.0)
- iProov (10.1.0):
- iProov (10.1.3):
- Starscream (~> 4.0)
- SwiftProtobuf (~> 1.0)
- Jumio (4.4.0):
- Jumio/All (= 4.4.0)
- Jumio/All (4.4.0):
- Jumio/Datadog (= 4.4.0)
- Jumio/DeviceRisk (= 4.4.0)
- Jumio/DocFinder (= 4.4.0)
- Jumio/Jumio (= 4.4.0)
- Jumio/Liveness (= 4.4.0)
- Jumio/Datadog (4.4.0):
- Jumio (4.5.0):
- Jumio/All (= 4.5.0)
- Jumio/All (4.5.0):
- Jumio/Datadog (= 4.5.0)
- Jumio/DeviceRisk (= 4.5.0)
- Jumio/DocFinder (= 4.5.0)
- Jumio/Jumio (= 4.5.0)
- Jumio/Liveness (= 4.5.0)
- Jumio/Datadog (4.5.0):
- DatadogSDK (= 1.11.1)
- Jumio/DeviceRisk (4.4.0)
- Jumio/DocFinder (4.4.0)
- Jumio/Jumio (4.4.0):
- Jumio/DeviceRisk (4.5.0)
- Jumio/DocFinder (4.5.0)
- Jumio/Jumio (4.5.0):
- PPpdf417 (= 8.0.0)
- Jumio/Liveness (4.4.0):
- iProov (= 10.1.0)
- jumio_mobile_sdk_flutter (4.4.0):
- Jumio/Liveness (4.5.0):
- iProov (= 10.1.3)
- jumio_mobile_sdk_flutter (4.5.0):
- Flutter
- Jumio (= 4.4.0)
- Jumio (= 4.5.0)
- PPpdf417 (8.0.0)
- Starscream (4.0.4)
- SwiftProtobuf (1.20.3)

DEPENDENCIES:
- Flutter (from `Flutter`)
Expand All @@ -38,7 +36,6 @@ SPEC REPOS:
- Jumio
- PPpdf417
- Starscream
- SwiftProtobuf

EXTERNAL SOURCES:
Flutter:
Expand All @@ -49,12 +46,11 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
DatadogSDK: ba0b08e235f938871691678efc4fb4032e7e27b2
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
iProov: 1baef733a065659d8f2b70f5d447a1d73f55d8d2
Jumio: dcba7b38500570fcea598f5fec3d8a9ce10e897b
jumio_mobile_sdk_flutter: 49917a94ee18855fe1364b2abb5513d0237957d9
iProov: e0616d6f785f669b261c956bfa00450a74c1234d
Jumio: 0dbdd19942970ff8f20cdbd9a72a974f50e86766
jumio_mobile_sdk_flutter: 0e5874514400e35b22ce9c4989327550f1e75bd1
PPpdf417: aa644766d51a7e00b8d41c70868bba8b818f5215
Starscream: 5178aed56b316f13fa3bc55694e583d35dd414d9
SwiftProtobuf: b02b5075dcf60c9f5f403000b3b0c202a11b6ae1

PODFILE CHECKSUM: c2211d48fe939fa71291b59548e1ffc6726497b1

Expand Down

0 comments on commit 98c0f52

Please sign in to comment.