diff --git a/README.md b/README.md index c5037919..8eafb757 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ - [FAQ](docs/integration_faq.md) # Release notes -SDK version: 3.4.0 +### SDK version: 3.4.0 #### Deprecation notice This is the last version that supports Android 4.x and 5.0. The minimum supported Android version will be increased to 5.1 in the next SDK version 3.5.0. @@ -23,6 +23,14 @@ This is the last version that supports Android 4.x and 5.0. The minimum supporte * Fixed several technical problems during face scanning [Netverify, Authentication] * Various smaller bug fixes/improvements [Netverify/Fastfill, Authentication, Document Verification] +### SDK version: 3.4.1 + +#### Changes +* Updated privacy policy within user journey [Netverify, Authentication] + +#### Fixes +* Fixed a problem that face capturing was not working in CustomUI on tablets [Netverify Custom UI] + # Basic Setup ## General Requirements @@ -128,7 +136,7 @@ Our SDK supports accessibility features. Visually impaired users can now enable # Support ## Previous version -The previous release version 3.3.2 of the Jumio Mobile SDK is supported until 2020-02-15. +The previous release version 3.4.0 of the Jumio Mobile SDK is supported until 2020-03-05. In case the support period is expired, no bug fixes and technical support are provided anymore (bugs are typically fixed in the upcoming versions). Older SDK versions will keep functioning with our server until further notice, but we highly recommend to always update to the latest version to benefit from SDK improvements and bug fixes. diff --git a/docs/integration_authentication.md b/docs/integration_authentication.md index 37df29f1..b1932599 100644 --- a/docs/integration_authentication.md +++ b/docs/integration_authentication.md @@ -15,7 +15,7 @@ Biometric-based Jumio Authentication establishes the digital identities of your - [Javadoc](https://jumio.github.io/mobile-sdk-android/) ## Release notes -For technical changes, please read our [transition guide](transition-guide_authentication.md) SDK version: 3.4.0 +For technical changes, please read our [transition guide](transition-guide_authentication.md) SDK version: 3.4.1 ## Setup The [basic setup](../README.md#basic-setup) is required before continuing with the following setup for Authentication. @@ -35,18 +35,18 @@ You can specify your own theme (see chapter [Customization](#customization)). Th ## Dependencies -The [Sample app](https://github.com/Jumio/mobile-sdk-android/blob/master/sample/JumioMobileSample/) apk size with the products Netverify, BAM, Document Verification and Authentication included is currently __27.44 MB__. +The [Sample app](https://github.com/Jumio/mobile-sdk-android/blob/master/sample/JumioMobileSample/) apk size with the products Netverify, BAM, Document Verification and Authentication included is currently __27.43 MB__. |Dependency | Mandatory | Description | Size (Jumio libs only) | | ---------------------------- |:-------------:|:-----------------|:---------:| -|com.jumio.android:core:3.4.0@aar | x | Jumio Core library | 4.10 MB | -|com.jumio.android:auth:3.4.0@aar | x | Authentication library | 89.57 KB | -|com.jumio.android:face:3.4.0@aar | x | Face library | 91.37 KB | +|com.jumio.android:core:3.4.1@aar | x | Jumio Core library | 4.11 MB | +|com.jumio.android:auth:3.4.1@aar | x | Authentication library | 89.26 KB | +|com.jumio.android:face:3.4.1@aar | x | Face library | 93.06 KB | |com.facetec:zoom-authentication:8.0.11@aar | x | Zoom face scanning library | 9.00 MB | |androidx.appcompat:appcompat:1.1.0 | x | Android appcompat library | - | |androidx.room:room-runtime:2.2.1 | x | Android database object mapping library | - | |com.google.android.material:material:1.0.0 | x | Android material design library | - | -|com.jumio.android:javadoc:3.4.0 | | Jumio SDK Javadoc | - | +|com.jumio.android:javadoc:3.4.1 | | Jumio SDK Javadoc | - | ### Others @@ -236,6 +236,8 @@ Using width as match_parent, the AuthenticationCustomScanView attribute ratio ne xmlns:yourNameSpace="http://schemas.android.com/apk/lib/com.jumio.mobile.sdk" ``` +`onAuthenticationUserConsentRequried` within *yourAuthenticationCustomSDKInterface* is invoked when the end-user’s consent to Jumio’s privacy policy is legally required. [onUserConsented](https://jumio.github.io/mobile-sdk-android/com/jumio/auth/custom/AuthenticationCustomSDKController.html#onUserConsented--) needs to be called after the end-user has accepted + Start scanning by providing an instance of the class `AuthenticationCustomScanView` and an instance of your class which implements the [AuthenticationCustomScanInterface](https://jumio.github.io/mobile-sdk-android/com/jumio/auth/custom/AuthenticationCustomScanInterface.html). ### Retrieving information diff --git a/docs/integration_bam-checkout.md b/docs/integration_bam-checkout.md index aea785b7..2fc4e81e 100644 --- a/docs/integration_bam-checkout.md +++ b/docs/integration_bam-checkout.md @@ -17,7 +17,7 @@ BAM Checkout SDK is a powerful, cutting-edge solution to extract data from your - [Javadoc](https://jumio.github.io/mobile-sdk-android/) ## Release notes -For technical changes, please read our [transition guide](transition-guide_bam-checkout.md) SDK version: 3.4.0 +For technical changes, please read our [transition guide](transition-guide_bam-checkout.md) SDK version: 3.4.1 ## Setup The [basic setup](../README.md#basic-setup) is required before continuing with the following setup for Bam-Checkout. @@ -42,11 +42,11 @@ If you want to use offline scanning for BAM Checkout (Credit card scanning), ple |Dependency | Mandatory | Description | Size (Jumio libs only) | | :---------------------------- |:-------------:|:-----------------|:------------:| -|com.jumio.android:core:3.4.0@aar | x | Jumio Core library| 4.10 MB | -|com.jumio.android:bam:3.4.0@aar | x | BAM Checkout library | 3.61 MB | +|com.jumio.android:core:3.4.1@aar | x | Jumio Core library| 4.11 MB | +|com.jumio.android:bam:3.4.1@aar | x | BAM Checkout library | 3.61 MB | |androidx.appcompat:appcompat:1.1.0 | x | Android appcompat library| - | |androidx.room:room-runtime:2.2.1 | x | Android database object mapping library | - | -|com.jumio.android:javadoc:3.4.0 | | Jumio SDK Javadoc| - | +|com.jumio.android:javadoc:3.4.1 | | Jumio SDK Javadoc| - | If an optional module is not linked, the scan method is not available but the library size is reduced. diff --git a/docs/integration_document-verification.md b/docs/integration_document-verification.md index 0dca77e7..140382e1 100644 --- a/docs/integration_document-verification.md +++ b/docs/integration_document-verification.md @@ -15,7 +15,7 @@ Document Verification is a powerful solution to enable scanning various types (U - [Javadoc](https://jumio.github.io/mobile-sdk-android/) ## Release notes -For technical changes, please read our [transition guide](transition-guide_document-verification.md) SDK version: 3.4.0 +For technical changes, please read our [transition guide](transition-guide_document-verification.md) SDK version: 3.4.1 ## Setup The [basic setup](../README.md#basic-setup) is required before continuing with the following setup for DocumentVerification. @@ -39,11 +39,11 @@ You can specify your own theme (see [Customization](#customizing-look-and-feel) | Dependency | Mandatory | Description | Size (Jumio libs only) | | ----------------- |:-------------------:|:------------------|:-------------------:| -| com.jumio.android:core:3.4.0@aar | x | Jumio Core library | 4.10 MB | -| com.jumio.android:dv:3.4.0@aar | x | Document Verification library | 118.74 KB | +| com.jumio.android:core:3.4.1@aar | x | Jumio Core library | 4.11 MB | +| com.jumio.android:dv:3.4.1@aar | x | Document Verification library | 118.77 KB | | androidx.appcompat:appcompat:1.1.0 | x | Android appcompat library | - | |androidx.room:room-runtime:2.2.1 | x | Android database object mapping library | - | -| com.jumio.android:javadoc:3.4.0 | | Jumio SDK Javadoc | - | +| com.jumio.android:javadoc:3.4.1 | | Jumio SDK Javadoc | - | If an optional module is not linked, the scan method is not available but the library size is reduced. diff --git a/docs/integration_netverify-fastfill.md b/docs/integration_netverify-fastfill.md index 31204655..045fd126 100644 --- a/docs/integration_netverify-fastfill.md +++ b/docs/integration_netverify-fastfill.md @@ -17,7 +17,7 @@ Jumio’s Netverify® ID Verification allows businesses to establish the genuine - [Javadoc](https://jumio.github.io/mobile-sdk-android/) ## Release notes -For technical changes, please read our [transition guide](transition-guide_netverify-fastfill.md) SDK version: 3.4.0 +For technical changes, please read our [transition guide](transition-guide_netverify-fastfill.md) SDK version: 3.4.1 ## Setup The [basic setup](../README.md#basic-setup) is required before continuing with the following setup for Netverify. @@ -56,28 +56,28 @@ If you want to use offline scanning for Fastfill please contact your Jumio Custo ## Dependencies If an optional module is __not linked__, the __scan method is not available__ but the library size is reduced. -The [Sample app](https://github.com/Jumio/mobile-sdk-android/blob/master/sample/JumioMobileSample/) apk size with the products Netverify, BAM, Document Verification and Authentication included is currently __27.44 MB__. +The [Sample app](https://github.com/Jumio/mobile-sdk-android/blob/master/sample/JumioMobileSample/) apk size with the products Netverify, BAM, Document Verification and Authentication included is currently __27.43 MB__. |Dependency | Mandatory | Description | Size (Jumio libs only) | | ---------------- |:-------------------:|:------------------------|:---------:| -|com.jumio.android:core:3.4.0@aar | x | Jumio Core library | 4.10 MB | -|com.jumio.android:nv:3.4.0@aar | x | Netverify library | 524.34 KB | +|com.jumio.android:core:3.4.1@aar | x | Jumio Core library | 4.11 MB | +|com.jumio.android:nv:3.4.1@aar | x | Netverify library | 522.18 KB | |androidx.appcompat:appcompat:1.1.0 | x | Android appcompat library | - | |androidx.cardview:cardview:1.0.0 | x | Android cardview library (Netverify only) | - | |androidx.room:room-runtime:2.2.1 | x | Android database object mapping library | - | |androidx.constraintlayout:constraintlayout:1.1.3 | x | Android constraint layout library | - | |com.google.android.gms:play-services-vision:18.0.0 | | Barcode Scanning | - | -|com.jumio.android:face:3.4.0@aar | | Face library | 91.37 KB | +|com.jumio.android:face:3.4.1@aar | | Face library | 93.06 KB | |com.facetec:zoom-authentication:8.0.11@aar | | Zoom face scanning library | 9.00 MB | |com.google.android.material:material:1.0.0 | | Android material design library | - | -|com.jumio.android:javadoc:3.4.0 | | Jumio SDK Javadoc | - | -|com.jumio.android:nv-barcode:3.4.0@aar | | US / CAN Barcode Scanning | 3.13 MB | -|com.jumio.android:nv-barcode-vision:3.4.0@aar | | US / CAN Barcode Scanning Alternative (reduced size) | 38.88 KB | -|com.jumio.android:nv-mrz:3.4.0@aar | | MRZ scanning | 2.09 MB | -|com.jumio.android:nv-nfc:3.4.0@aar | | eMRTD Scanning | 771.16 KB | +|com.jumio.android:javadoc:3.4.1 | | Jumio SDK Javadoc | - | +|com.jumio.android:nv-barcode:3.4.1@aar | | US / CAN Barcode Scanning | 3.13 MB | +|com.jumio.android:nv-barcode-vision:3.4.1@aar | | US / CAN Barcode Scanning Alternative (reduced size) | 38.89 KB | +|com.jumio.android:nv-mrz:3.4.1@aar | | MRZ scanning | 2.09 MB | +|com.jumio.android:nv-nfc:3.4.1@aar | | eMRTD Scanning | 771.17 KB | |org.bouncycastle:bcprov-jdk15on:1.61 | | eMRTD Scanning | - | |net.sf.scuba:scuba-sc-android:0.0.18 | | eMRTD Scanning | - | -|com.jumio.android:nv-ocr:3.4.0@aar | | Template Matcher | 1.07 MB | +|com.jumio.android:nv-ocr:3.4.1@aar | | Template Matcher | 1.08 MB | #### Dependency conflicts If the dependency `com.jumio.android:nv-barcode-vision` is used in the application, the following lines have to be added to the application tag in the AndroidManifest.xml to avoid merge issues (see [AndroidManifest.xml](https://github.com/Jumio/mobile-sdk-android/blob/master/sample/JumioMobileSample/src/main/AndroidManifest.xml) in Sample app): @@ -114,7 +114,7 @@ In case of __DIALOG_PENDING__, the `requestCode` provided in the method above ca If you use Netverify and BAM Checkout in your app, add the following dependency: ``` -implementation "com.jumio.android:bam:3.4.0@aar" +implementation "com.jumio.android:bam:3.4.1@aar" ``` #### Root detection @@ -448,6 +448,8 @@ public Set getDocumentVariants(NVDocumentType documentType); **[NVScanSide](https://jumio.github.io/mobile-sdk-android/com/jumio/core/data/document/ScanSide.html)** values: `FRONT`, `BACK`, `FACE` +`onNetverifyUserConsentRequried` within *yourNetverifyCustomSDKInterface* is invoked when the end-user’s consent to Jumio’s privacy policy is legally required. [onUserConsented](https://jumio.github.io/mobile-sdk-android/com/jumio/nv/custom/NetverifyCustomSDKController.html#onUserConsented--) needs to be called after the end-user has accepted + After `onNetverifyResourcesLoaded` within *yourNetverifyCustomSDKInterface*, start scanning by providing a ScanSide from the list, instances of the class `NetverifyCustomScanView` and `NetverifyCustomConfirmationView`, and an instance of your class which implements the `NetverifyCustomScanInterface`. You will receive a `NetverifyCustomScanPresenter` object. diff --git a/docs/transition-guide_authentication.md b/docs/transition-guide_authentication.md index 5ddd36bc..2526fc02 100644 --- a/docs/transition-guide_authentication.md +++ b/docs/transition-guide_authentication.md @@ -1,9 +1,13 @@ -![Fastfill & Netverify](images/authentication.jpg) +![Authentication](images/authentication.jpg) # Transition guide for Authentication SDK This section only covers the breaking technical changes that should be considered when updating from the previous version. +## 3.4.1 +* A new callback [onAuthenticationUserConsentRequired](https://jumio.github.io/mobile-sdk-android/com/jumio/auth/custom/AuthenticationCustomSDKInterface.html#onAuthenticationUserConsentRequired-java.lang.String-) was added to [AuthenticationCustomScanInterface](https://jumio.github.io/mobile-sdk-android/com/jumio/auth/custom/AuthenticationCustomScanInterface.html) +* A new method [onUserConsented](https://jumio.github.io/mobile-sdk-android/com/jumio/auth/custom/AuthenticationCustomSDKController.html#onUserConsented--) was added to [AuthenticationCustomSDKController](https://jumio.github.io/mobile-sdk-android/com/jumio/auth/custom/AuthenticationCustomSDKController.html) + ## 3.4.0 #### Dependency change * ~~androidx.appcompat:appcompat:1.0.2~~ is replaced by androidx.appcompat:appcompat:1.1.0 diff --git a/docs/transition-guide_bam-checkout.md b/docs/transition-guide_bam-checkout.md index 4e98bec2..23d034a7 100644 --- a/docs/transition-guide_bam-checkout.md +++ b/docs/transition-guide_bam-checkout.md @@ -4,6 +4,9 @@ This section only covers the breaking technical changes that should be considered when updating from the previous version. +## 3.4.1 +No backward incompatible changes + ## 3.4.0 #### Dependency change * ~~androidx.appcompat:appcompat:1.0.2~~ is replaced by androidx.appcompat:appcompat:1.1.0 diff --git a/docs/transition-guide_document-verification.md b/docs/transition-guide_document-verification.md index 6dc10319..66774bbf 100644 --- a/docs/transition-guide_document-verification.md +++ b/docs/transition-guide_document-verification.md @@ -4,6 +4,9 @@ This section only covers the breaking technical changes that should be considered when updating from the previous version. +## 3.4.1 +No backward incompatible changes + ## 3.4.0 #### Dependency change * ~~androidx.appcompat:appcompat:1.0.2~~ is replaced by androidx.appcompat:appcompat:1.1.0 diff --git a/docs/transition-guide_netverify-fastfill.md b/docs/transition-guide_netverify-fastfill.md index 703158e9..cb23253f 100644 --- a/docs/transition-guide_netverify-fastfill.md +++ b/docs/transition-guide_netverify-fastfill.md @@ -4,8 +4,11 @@ This section only covers the breaking technical changes that should be considered when updating from the previous version. -## 3.4.0 +## 3.4.1 +* A new callback [onNetverifyUserConsentRequired](https://jumio.github.io/mobile-sdk-android/com/jumio/nv/custom/NetverifyCustomSDKInterface.html#onNetverifyUserConsentRequired-java.lang.String-) was added to [NetverifyCustomScanInterface](https://jumio.github.io/mobile-sdk-android/com/jumio/nv/custom/NetverifyCustomScanInterface.html) +* A new method [onUserConsented](https://jumio.github.io/mobile-sdk-android/com/jumio/nv/custom/NetverifyCustomSDKController.html#onUserConsented--) was added to [NetverifyCustomSDKController](https://jumio.github.io/mobile-sdk-android/com/jumio/nv/custom/NetverifyCustomSDKController.html) +## 3.4.0 #### Customization changes * The SDK now uses Material buttons instead of the old snackbar button styles on the confirmation view. * Please check out the confirmation screens and the XML output in the [Surface Tool](https://jumio.github.io/surface-android/) for all adapted content. diff --git a/sample/JumioMobileSample/build.gradle b/sample/JumioMobileSample/build.gradle index a4589a39..0e5c81bc 100644 --- a/sample/JumioMobileSample/build.gradle +++ b/sample/JumioMobileSample/build.gradle @@ -20,7 +20,7 @@ repositories { } ext { - SDK_VERSION = "3.4.0" + SDK_VERSION = "3.4.1" } dependencies { diff --git a/sample/JumioMobileSample/src/main/java/com/jumio/sample/java/AuthenticationCustomFragment.java b/sample/JumioMobileSample/src/main/java/com/jumio/sample/java/AuthenticationCustomFragment.java index 389ace7d..ce4caf74 100644 --- a/sample/JumioMobileSample/src/main/java/com/jumio/sample/java/AuthenticationCustomFragment.java +++ b/sample/JumioMobileSample/src/main/java/com/jumio/sample/java/AuthenticationCustomFragment.java @@ -8,6 +8,8 @@ import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.os.Bundle; +import android.text.method.LinkMovementMethod; +import android.text.util.Linkify; import android.util.Log; import android.view.Display; import android.view.LayoutInflater; @@ -64,6 +66,7 @@ public class AuthenticationCustomFragment extends Fragment implements View.OnCli private LinearLayout customScanContainer; private LinearLayout partTypeLayout; private LinearLayout callbackLog; + private LinearLayout userConsentLayout; private FrameLayout customScanLayout; private AuthenticationCustomScanView customScanView; private AuthenticationCustomAnimationView customAnimationView; @@ -74,6 +77,7 @@ public class AuthenticationCustomFragment extends Fragment implements View.OnCli private Button faceButton; private Button errorRetryButton; private Button partRetryButton; + private Button userConsentedButton; private AuthenticationCustomSDKController customSDKController; private Drawable successDrawable; @@ -98,6 +102,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, customScanContainer = rootView.findViewById(R.id.authenticationCustomContainer); partTypeLayout = rootView.findViewById(R.id.partTypeLayout); customScanLayout = rootView.findViewById(R.id.customScanLayout); + userConsentLayout = rootView.findViewById(R.id.userConsentLayout); callbackLog = rootView.findViewById(R.id.callbackLog); customScanView = rootView.findViewById(R.id.authenticationCustomScanView); customAnimationView = rootView.findViewById(R.id.authenticationCustomAnimationView); @@ -108,12 +113,15 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, faceButton = rootView.findViewById(R.id.faceButton); errorRetryButton = rootView.findViewById(R.id.errorRetryButton); partRetryButton = rootView.findViewById(R.id.partRetryButton); + userConsentedButton = rootView.findViewById(R.id.userConsentedButton); + startCustomScanButton.setOnClickListener(this); cancelCustomScanButton.setOnClickListener(this); faceButton.setOnClickListener(this); errorRetryButton.setOnClickListener(this); partRetryButton.setOnClickListener(this); + userConsentedButton.setOnClickListener(this); startCustomScanButton.setText(String.format(getResources().getString(R.string.button_start), getResources().getString(R.string.section_authentication))); @@ -238,6 +246,10 @@ public void run() { scrollView.postDelayed(new ScanPartRunnable(), 250); } }); + } else if (v == userConsentedButton && isSDKControllerValid()) { + customSDKController.setUserConsented(); + + hideView(false, userConsentLayout); } else if (v == partRetryButton && isSDKControllerValid()) { customAnimationView.destroy(); hideView(false, partRetryButton, customAnimationView); @@ -382,6 +394,7 @@ public void run() { customSDKController.startScan(customScanView, new AuthenticationCustomScanImpl()); addToCallbackLog("help text: " + customSDKController.getHelpText()); } catch (SDKNotConfiguredException e) { + hideView(false, customScanLayout); addToCallbackLog(e.getMessage()); } } @@ -434,6 +447,15 @@ public void onAuthenticationError(String errorCode, String errorMessage, boolean hideView(false, partTypeLayout, loadingIndicator, errorRetryButton, partRetryButton); } } + + @Override + public void onAuthenticationUserConsentRequried(String privacyPolicy) { + showView(true, userConsentLayout); + TextView userConsentUrl = userConsentLayout.findViewById(R.id.userConsentUrl); + userConsentUrl.setText(privacyPolicy); + Linkify.addLinks(userConsentUrl, Linkify.WEB_URLS); + userConsentUrl.setMovementMethod(LinkMovementMethod.getInstance()); + } } private class AuthenticationCustomScanImpl implements AuthenticationCustomScanInterface { diff --git a/sample/JumioMobileSample/src/main/java/com/jumio/sample/java/NetverifyCustomFragment.java b/sample/JumioMobileSample/src/main/java/com/jumio/sample/java/NetverifyCustomFragment.java index a65dd64d..af534525 100644 --- a/sample/JumioMobileSample/src/main/java/com/jumio/sample/java/NetverifyCustomFragment.java +++ b/sample/JumioMobileSample/src/main/java/com/jumio/sample/java/NetverifyCustomFragment.java @@ -13,6 +13,8 @@ import android.text.InputFilter; import android.text.Spanned; import android.text.format.DateFormat; +import android.text.method.LinkMovementMethod; +import android.text.util.Linkify; import android.util.Log; import android.view.Display; import android.view.LayoutInflater; @@ -100,6 +102,7 @@ public class NetverifyCustomFragment extends Fragment implements View.OnClickLis private LinearLayout callbackLog; private LinearLayout netverifySettingsContainer; private LinearLayout customNfcAccessLayout; + private LinearLayout userConsentLayout; private RelativeLayout customScanLayout; private RelativeLayout customConfirmLayout; private RelativeLayout customNfcLayout; @@ -129,6 +132,7 @@ public class NetverifyCustomFragment extends Fragment implements View.OnClickLis private Button finishButton; private Button nfcRetryButton; private Button nfcCancelButton; + private Button userConsentedButton; private Switch switchVerification; private Switch switchIdentityVerification; private TextInputEditText idNumberEditText; @@ -168,6 +172,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, customScanLayout = rootView.findViewById(R.id.customScanLayout); customConfirmLayout = rootView.findViewById(R.id.customConfirmLayout); customNfcLayout = rootView.findViewById(R.id.customNfcLayout); + userConsentLayout = rootView.findViewById(R.id.userConsentLayout); customScanView = rootView.findViewById(R.id.netverifyCustomScanView); customConfirmationView = rootView.findViewById(R.id.netverifyCustomConfirmationView); customAnimationView = rootView.findViewById(R.id.netverifyCustomAnimationView); @@ -194,6 +199,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, finishButton = rootView.findViewById(R.id.finishButton); nfcRetryButton = rootView.findViewById(R.id.nfcRetryButton); nfcCancelButton = rootView.findViewById(R.id.nfcCancelButton); + userConsentedButton = rootView.findViewById(R.id.userConsentedButton); switchVerification = rootView.findViewById(R.id.switchVerification); switchIdentityVerification = rootView.findViewById(R.id.switchIdentitiyVerification); idNumberEditText = rootView.findViewById(R.id.idNumberEditText); @@ -219,6 +225,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, finishButton.setOnClickListener(this); nfcRetryButton.setOnClickListener(this); nfcCancelButton.setOnClickListener(this); + userConsentedButton.setOnClickListener(this); startCustomScanButton.setText(String.format(getResources().getString(R.string.button_start), getResources().getString(R.string.section_netverify_custom))); @@ -386,6 +393,9 @@ public void onClick(final View v) { } catch (SDKNotConfiguredException e) { e.printStackTrace(); } + } else if (v == userConsentedButton && isSDKControllerValid()) { + customSDKController.setUserConsented(); + hideView(false, userConsentLayout); } else if ((v == frontSideButton || v == backSideButton || v == faceButton) && isSDKControllerValid()) { customScanView.setMode(v == faceButton?NetverifyCustomScanView.MODE_FACE:NetverifyCustomScanView.MODE_ID); initScanView(); @@ -668,6 +678,8 @@ public void run() { startFallback.setEnabled(customScanViewPresenter.isFallbackAvailable()); } catch (SDKNotConfiguredException e) { + hideView(false, customScanLayout, customScanView); + addToCallbackLog(e.getMessage()); frontSideButton.setEnabled(true); backSideButton.setEnabled(true); @@ -759,6 +771,15 @@ public void onNothingSelected(AdapterView parent) { }); } + @Override + public void onNetverifyUserConsentRequried(String privacyPolicy) { + showView(true, userConsentLayout); + TextView userConsentUrl = userConsentLayout.findViewById(R.id.userConsentUrl); + userConsentUrl.setText(privacyPolicy); + Linkify.addLinks(userConsentUrl, Linkify.WEB_URLS); + userConsentUrl.setMovementMethod(LinkMovementMethod.getInstance()); + } + @Override public void onNetverifyResourcesLoaded() { addToCallbackLog("onNetverifyResourcesLoaded"); diff --git a/sample/JumioMobileSample/src/main/java/com/jumio/sample/kotlin/AuthenticationCustomFragment.kt b/sample/JumioMobileSample/src/main/java/com/jumio/sample/kotlin/AuthenticationCustomFragment.kt index 4c1fbbf5..0c8d69af 100644 --- a/sample/JumioMobileSample/src/main/java/com/jumio/sample/kotlin/AuthenticationCustomFragment.kt +++ b/sample/JumioMobileSample/src/main/java/com/jumio/sample/kotlin/AuthenticationCustomFragment.kt @@ -8,6 +8,8 @@ import android.graphics.Rect import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.Drawable import android.os.Bundle +import android.text.method.LinkMovementMethod +import android.text.util.Linkify import android.util.Log import android.view.LayoutInflater import android.view.View @@ -93,6 +95,7 @@ class AuthenticationCustomFragment : Fragment(), View.OnClickListener, Authentic faceButton?.setOnClickListener(this) errorRetryButton?.setOnClickListener(this) partRetryButton?.setOnClickListener(this) + userConsentedButton?.setOnClickListener(this) hideView(false, errorRetryButton, partRetryButton, authenticationCustomAnimationView) } @@ -183,6 +186,10 @@ class AuthenticationCustomFragment : Fragment(), View.OnClickListener, Authentic scrollView?.scrollTo(0, customScanLayout?.top ?:0) scrollView?.postDelayed(ScanPartRunnable(), 250) } + } else if (v === userConsentedButton && isSDKControllerValid) { + customSDKController?.setUserConsented() + + hideView(false, userConsentLayout) } else if (v === partRetryButton && isSDKControllerValid) { authenticationCustomAnimationView?.destroy() hideView(false, partRetryButton, authenticationCustomAnimationView) @@ -346,6 +353,7 @@ class AuthenticationCustomFragment : Fragment(), View.OnClickListener, Authentic customSDKController?.startScan(authenticationCustomScanView, AuthenticationCustomScanImpl()) addToCallbackLog("help text: " + customSDKController?.helpText) } catch (e: Exception) { + hideView(false, customScanLayout) addToCallbackLog(e.message) } } @@ -398,6 +406,13 @@ class AuthenticationCustomFragment : Fragment(), View.OnClickListener, Authentic hideView(false, partTypeLayout, loadingIndicator, errorRetryButton, partRetryButton) } } + + override fun onAuthenticationUserConsentRequried(privacyPolicy: String?) { + showView(true, userConsentLayout) + userConsentUrl?.text = privacyPolicy + Linkify.addLinks(userConsentUrl, Linkify.WEB_URLS); + userConsentUrl?.movementMethod = LinkMovementMethod.getInstance() + } } private inner class AuthenticationCustomScanImpl : AuthenticationCustomScanInterface { diff --git a/sample/JumioMobileSample/src/main/java/com/jumio/sample/kotlin/NetverifyCustomFragment.kt b/sample/JumioMobileSample/src/main/java/com/jumio/sample/kotlin/NetverifyCustomFragment.kt index 2b32e025..07eceb22 100644 --- a/sample/JumioMobileSample/src/main/java/com/jumio/sample/kotlin/NetverifyCustomFragment.kt +++ b/sample/JumioMobileSample/src/main/java/com/jumio/sample/kotlin/NetverifyCustomFragment.kt @@ -13,6 +13,8 @@ import android.os.Bundle import android.text.InputFilter import android.text.Spanned import android.text.format.DateFormat +import android.text.method.LinkMovementMethod +import android.text.util.Linkify import android.util.Log import android.view.LayoutInflater import android.view.View @@ -124,6 +126,7 @@ class NetverifyCustomFragment : Fragment(), View.OnClickListener, NetverifyDeall finishButton?.setOnClickListener(this) nfcCancelButton?.setOnClickListener(this) nfcRetryButton?.setOnClickListener(this) + userConsentedButton.setOnClickListener(this) hideView(false, countryDocumentLayout, partTypeLayout, finishButton, errorRetryButton, partRetryButton, netverifyCustomAnimationView) } @@ -263,12 +266,15 @@ class NetverifyCustomFragment : Fragment(), View.OnClickListener, NetverifyDeall } catch (e: Exception) { e.printStackTrace() } - + } else if (v === userConsentedButton && isSDKControllerValid) { + customSDKController?.setUserConsented() + hideView(false, userConsentLayout) } else if ((v === frontSideButton || v === backSideButton || v === faceButton) && isSDKControllerValid) { netverifyCustomScanView?.mode = if (v === faceButton) NetverifyCustomScanView.MODE_FACE else NetverifyCustomScanView.MODE_ID initScanView() showView(true, customScanLayout, netverifyCustomScanView) + scrollView?.post { scrollView?.scrollTo(0, customScanLayout?.top ?: 0) scrollView?.postDelayed(ScanPartRunnable(v), 250) @@ -507,6 +513,8 @@ class NetverifyCustomFragment : Fragment(), View.OnClickListener, NetverifyDeall startFallback?.isEnabled = customScanViewPresenter?.isFallbackAvailable == true } catch (e: SDKNotConfiguredException) { + hideView(false, customScanLayout, netverifyCustomScanView) + addToCallbackLog(e.message) frontSideButton?.isEnabled = true backSideButton?.isEnabled = true @@ -543,7 +551,6 @@ class NetverifyCustomFragment : Fragment(), View.OnClickListener, NetverifyDeall } private inner class NetverifyCustomSDKImpl : NetverifyCustomSDKInterface { - //Custom SDK Interface override fun onNetverifyCountriesReceived(countryList: HashMap, userCountryCode: String) { addToCallbackLog("onNetverifyCountriesReceived - user Country is $userCountryCode") @@ -588,6 +595,13 @@ class NetverifyCustomFragment : Fragment(), View.OnClickListener, NetverifyDeall } } + override fun onNetverifyUserConsentRequried(privacyPolicy: String?) { + showView(true, userConsentLayout) + userConsentUrl?.text = privacyPolicy + Linkify.addLinks(userConsentUrl, Linkify.WEB_URLS); + userConsentUrl?.movementMethod = LinkMovementMethod.getInstance() + } + override fun onNetverifyResourcesLoaded() { addToCallbackLog("onNetverifyResourcesLoaded") frontSideButton?.isEnabled = true diff --git a/sample/JumioMobileSample/src/main/res/layout/fragment_authentication_custom.xml b/sample/JumioMobileSample/src/main/res/layout/fragment_authentication_custom.xml index 44dc03a4..baa62a31 100644 --- a/sample/JumioMobileSample/src/main/res/layout/fragment_authentication_custom.xml +++ b/sample/JumioMobileSample/src/main/res/layout/fragment_authentication_custom.xml @@ -78,6 +78,24 @@ + + + +