### React Native Project Setup and Jumio Module Installation Source: https://github.com/jumio/mobile-react/blob/master/README.md This snippet demonstrates how to initialize a new React Native project and then install the Jumio Mobile SDK module using npm, followed by running `pod install` for iOS dependencies. ```sh react-native init MyProject cd MyProject npm install --save https://github.com/Jumio/mobile-react.git#v4.13.0 cd ios && pod install ``` -------------------------------- ### Install Node.js Dependencies for React Native Source: https://github.com/jumio/mobile-react/blob/master/DemoApp/README.md This command installs all necessary Node.js packages and dependencies required for the React Native demo application to function correctly. ```bash npm install ``` -------------------------------- ### Run React Native iOS Application Source: https://github.com/jumio/mobile-react/blob/master/DemoApp/README.md These commands navigate into the iOS project directory, install CocoaPods dependencies, and then launch the React Native application on an iOS simulator or a connected device. ```bash cd ios pod install cd .. react-native run-ios or react-native run-ios --device ``` -------------------------------- ### Start Jumio Mobile SDK Source: https://github.com/jumio/mobile-react/blob/master/README.md This JavaScript snippet shows how to start the Jumio Mobile SDK after it has been initialized, initiating the verification process. ```javascript JumioMobileSDK.start(); ``` -------------------------------- ### Run React Native Android Application Source: https://github.com/jumio/mobile-react/blob/master/DemoApp/README.md These commands are used to launch the React Native application on an Android emulator or device. It provides options for both Windows-specific execution and a general React Native command. ```bash npm run android-windows // or react-native run-android ``` -------------------------------- ### Add Podfile Post-Install Hook for Distribution Builds Source: https://github.com/jumio/mobile-react/blob/master/DemoApp/README.md This Ruby code snippet adds a post-install hook to the Podfile. It iterates through build configurations to set `BUILD_LIBRARY_FOR_DISTRIBUTION` to 'YES', which is crucial for building dependencies for release. It also includes standard React Native post-install steps and a workaround for Xcode 12.5 M1 issues. ```Ruby post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES' end end react_native_post_install( installer, config[:reactNativePath], :mac_catalyst_enabled => false ) __apply_Xcode_12_5_M1_post_install_workaround(installer) end ``` -------------------------------- ### Add Podfile Pre-Install Hook for Static/Dynamic Frameworks Source: https://github.com/jumio/mobile-react/blob/master/DemoApp/README.md This Ruby code snippet adds a pre-install hook to the Podfile. It overrides the `static_framework?` and `build_type` methods for each pod target, ensuring that specific dependencies like iProov's SocketIO and Starscream are built as dynamic frameworks while other React Native dependencies remain static libraries, addressing compatibility requirements. ```Ruby pre_install do |installer| installer.pod_targets.each do |pod| puts "Overriding the static_framework? method for #{pod.name}" def pod.static_framework?; true end def pod.build_type; Pod::BuildType.static_library end end end ``` -------------------------------- ### Configure Android Build Directory in build.gradle Source: https://github.com/jumio/mobile-react/blob/master/DemoApp/README.md This JavaScript/Groovy snippet should be added to the project-level `build.gradle` file. It redefines the `buildDir` for all projects, directing build artifacts to a temporary path. This modification helps resolve `Unable to crunch file` errors, particularly on Windows systems. ```javascript allprojects { buildDir = "C:/tmp/${rootProject.name}/${project.name}" } ``` -------------------------------- ### Set iOS Deployment Target for Specific Pods (Xcode 15+) Source: https://github.com/jumio/mobile-react/blob/master/README.md This `post_install` hook addresses build issues with Xcode 15 and above by setting the `IPHONEOS_DEPLOYMENT_TARGET` to '12.0' for specific pods ('iProov', 'DatadogRUM', 'DatadogCore', 'DatadogInternal'). This ensures compatibility and prevents crashes on application start. ```Ruby post_install do |installer| installer.pods_project.targets.each do |target| if ['iProov', 'DatadogRUM', 'DatadogCore', 'DatadogInternal'].include? target.name target.build_configurations.each do |config| config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0' end end end end ``` -------------------------------- ### JumioMobileSDK iOS Appearance Customization Source: https://github.com/jumio/mobile-react/blob/master/README.md Examples demonstrating how to customize the JumioSDK iOS appearance by passing color customization options to the `setupCustomizations()` function. Colors can be specified as HEX strings, either uniformly for both light and dark modes or distinctly for each mode. ```JavaScript JumioMobileSDK.setupCustomizations({ primaryColor: { light:"ffffff", dark:"000000" }, primaryButtonBackground: { light:"ffffff", dark:"000000" } }); ``` ```JavaScript JumioMobileSDK.setupCustomizations({ primaryColor: "ffffff", primaryButtonBackground: "ffffff" }); ``` -------------------------------- ### Initialize Jumio Mobile SDK Source: https://github.com/jumio/mobile-react/blob/master/README.md This JavaScript snippet demonstrates how to initialize the Jumio Mobile SDK by calling `initialize` with an `AUTHORIZATION_TOKEN` and `DATACENTER` (US, EU, or SG). ```javascript JumioMobileSDK.initialize(, ); ``` -------------------------------- ### JumioSDK iOS Customization Keys Reference Source: https://github.com/jumio/mobile-react/blob/master/README.md A comprehensive list of all available customization keys that can be used with the `JumioMobileSDK.setupCustomizations()` function. Each key represents a specific UI element or property whose color can be modified using HEX color strings. ```APIDOC JumioSDK iOS Customization Keys for setupCustomizations(): - facePrimary - faceSecondary - faceOutline - faceAnimationForeground - iProovFilterForegroundColor - iProovFilterBackgroundColor - iProovTitleTextColor - iProovCloseButtonTintColor - iProovSurroundColor - iProovPromptTextColor - iProovPromptBackgroundColor - genuinePresenceAssuranceReadyOvalStrokeColor - genuinePresenceAssuranceNotReadyOvalStrokeColor - livenessAssuranceOvalStrokeColor - livenessAssuranceCompletedOvalStrokeColor - primaryButtonBackground - primaryButtonBackgroundPressed - primaryButtonBackgroundDisabled - primaryButtonForeground - primaryButtonForegroundPressed - primaryButtonForegroundDisabled - primaryButtonOutline - secondaryButtonBackground - secondaryButtonBackgroundPressed - secondaryButtonBackgroundDisabled - secondaryButtonForeground - secondaryButtonForegroundPressed - secondaryButtonForegroundDisabled - secondaryButtonOutline - bubbleBackground - bubbleForeground - bubbleBackgroundSelected - bubbleOutline - loadingCirclePlain - loadingCircleGradientStart - loadingCircleGradientEnd - loadingErrorCircleGradientStart - loadingErrorCircleGradientEnd - loadingCircleIcon - scanOverlay - scanOverlayBackground - nfcPassportCover - nfcPassportPageDark - nfcPassportPageLight - nfcPassportForeground - nfcPhoneCover - scanViewTooltipForeground - scanViewTooltipBackground - scanViewForeground - scanViewDocumentShutter - scanViewFaceShutter - searchBubbleBackground - searchBubbleForeground - searchBubbleOutline - confirmationImageBackground - confirmationImageBackgroundBorder - confirmationIndicatorActive - confirmationIndicatorDefault - confirmationImageBorder - background - navigationIconColor - textForegroundColor - primaryColor - selectionIconForeground ``` -------------------------------- ### Configure Pods for Static Libraries in React Native Source: https://github.com/jumio/mobile-react/blob/master/README.md This `pre_install` hook in the Podfile ensures that all pods are built as static libraries, overriding the default behavior for dynamic frameworks. This is necessary because React Native primarily supports static libraries, especially for iProov dependencies in Jumio SDK 3.8.0 and newer. ```Ruby pre_install do |installer| installer.pod_targets.each do |pod| puts "Overriding the static_framework? method for #{pod.name}" def pod.static_framework?; true end def pod.build_type; Pod::BuildType.static_library end end end ``` -------------------------------- ### Enable Library Distribution Build for Specific Pods Source: https://github.com/jumio/mobile-react/blob/master/README.md This `post_install` hook sets the `BUILD_LIBRARY_FOR_DISTRIBUTION` flag to 'YES' for specific pods like 'iProov', 'DatadogRUM', 'DatadogCore', and 'DatadogInternal'. This is crucial for ensuring these dependencies are correctly built for distribution, especially when using dynamic frameworks. ```Ruby post_install do |installer| installer.pods_project.targets.each do |target| if ['iProov', 'DatadogRUM', 'DatadogCore', 'DatadogInternal'].include? target.name target.build_configurations.each do |config| config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES' end end end end ``` -------------------------------- ### Configure Jumio Mobile SDK Maven Repository Source: https://github.com/jumio/mobile-react/blob/master/README.md This Groovy snippet adds the Jumio Mobile SDK Maven repository to your `build.gradle` file, specifying `exclusiveContent` and `filter` rules to include necessary Jumio and iProov SDK groups. ```groovy exclusiveContent { forRepository { maven { url 'https://repo.mobile.jumio.ai' } } filter { includeGroup "com.jumio.android" includeGroup "com.iproov.sdk" } } ``` -------------------------------- ### Import NativeModules in React Native Source: https://github.com/jumio/mobile-react/blob/master/README.md This JavaScript snippet demonstrates how to import `NativeModules` from the `react-native` library, which is essential for interacting with native modules like the Jumio SDK. ```javascript import { ... NativeModules } from 'react-native'; ``` -------------------------------- ### Upgrade Gradle Wrapper Version Source: https://github.com/jumio/mobile-react/blob/master/README.md This snippet shows how to update the `distributionUrl` in `gradle-wrapper.properties` to use Gradle version `8.9`, ensuring compatibility with the updated Android build tools. ```text distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip ``` -------------------------------- ### Android compileSdkVersion and buildToolsVersion Configuration Source: https://github.com/jumio/mobile-react/blob/master/README.md This Groovy snippet for `build.gradle` demonstrates setting the `compileSdkVersion` and `buildToolsVersion` to ensure compatibility with the Jumio SDK requirements. ```groovy android { compileSdkVersion 33 buildToolsVersion "33.0.0" ... } ``` -------------------------------- ### Android Manifest allowBackup Configuration Source: https://github.com/jumio/mobile-react/blob/master/README.md This XML snippet shows how to set the `android:allowBackup` attribute to `false` within the `` tag in your `AndroidManifest.xml` file, which is a requirement for the Jumio SDK. ```xml ``` -------------------------------- ### Enable Android MultiDex Source: https://github.com/jumio/mobile-react/blob/master/README.md This Groovy snippet shows how to enable MultiDex support in your `build.gradle` file by setting `multiDexEnabled` to `true` within the `defaultConfig` block, as required for larger Android applications. ```groovy android { ... defaultConfig { ... multiDexEnabled true } } ``` -------------------------------- ### Create JumioMobileSDK Variable in React Native Source: https://github.com/jumio/mobile-react/blob/master/README.md This JavaScript snippet shows how to destructure `JumioMobileSDK` from `NativeModules`, making the Jumio SDK accessible within your React Native application. ```javascript const { JumioMobileSDK } = NativeModules; ``` -------------------------------- ### Importing NativeEventEmitter for React Native Events Source: https://github.com/jumio/mobile-react/blob/master/README.md This snippet demonstrates how to import `NativeEventEmitter` from `react-native`, which is essential for listening to native events emitted by the Jumio Mobile SDK. ```javascript import { ... NativeEventEmitter } from 'react-native'; ``` -------------------------------- ### Listening to Jumio Mobile SDK Events (Result and Error) Source: https://github.com/jumio/mobile-react/blob/master/README.md This code shows how to set up event listeners for `EventResult` and `EventError` using `NativeEventEmitter` to capture scanned data and errors from the Jumio Mobile SDK. It logs the received JSON data to the console for debugging. ```javascript const emitterJumio = new NativeEventEmitter(JumioMobileSDK); emitterJumio.addListener( 'EventResult', (EventResult) => console.warn("EventResult: " + JSON.stringify(EventResult)) ); emitterJumio.addListener( 'EventError', (EventError) => console.warn("EventError: " + JSON.stringify(EventError)) ); ``` -------------------------------- ### Upgrade Android Gradle Build Tools Version Source: https://github.com/jumio/mobile-react/blob/master/README.md This Groovy snippet updates the `classpath` for `com.android.tools.build:gradle` to version `8.7.3` in the `buildscript` dependencies, which is necessary for the Jumio plugin. ```groovy buildscript { ... dependencies { ... classpath 'com.android.tools.build:gradle:8.7.3' } } ``` -------------------------------- ### Proguard Rule for Android Face Help Animation Fix Source: https://github.com/jumio/mobile-react/blob/master/README.md This Proguard rule is necessary to prevent the face help animation from breaking in Android release builds. It ensures that the `androidx.constraintlayout.motion.widget` package is not obfuscated or optimized away. ```Proguard -keep class androidx.constraintlayout.motion.widget.** { *; } ``` -------------------------------- ### MRZ Data Structure Definition Source: https://github.com/jumio/mobile-react/blob/master/README.md Defines the structure and validation parameters for Machine Readable Zone (MRZ) data extracted by the Jumio SDK. This includes format types, line content, and boolean flags indicating the validity of various check digits. ```APIDOC MRZ-Data: format: type: String maxLength: 8 description: MRP, TD1, TD2, CNIS, MRVA, MRVB or UNKNOWN line1: type: String maxLength: 50 description: MRZ line 1 line2: type: String maxLength: 50 description: MRZ line 2 line3: type: String maxLength: 50 description: MRZ line 3 idNumberValid: type: BOOL description: True if ID number check digit is valid, otherwise false dobValid: type: BOOL description: True if date of birth check digit is valid, otherwise false expiryDateValid: type: BOOL description: True if date of expiry check digit is valid or not available, otherwise false personalNumberValid: type: BOOL description: True if personal number check digit is valid or not available, otherwise false compositeValid: type: BOOL description: True if composite check digit is valid, otherwise false ``` -------------------------------- ### Android Theme Customization for Jumio Mobile SDK Source: https://github.com/jumio/mobile-react/blob/master/README.md Jumio SDK's Android appearance can be customized by overriding the `AppThemeCustomJumio` theme. This involves modifying the `styles.xml` file in your Android project to define custom values for the theme attributes, allowing for a tailored user interface. ```APIDOC Android Customization: Theme Name: AppThemeCustomJumio Configuration File: DemoApp/android/app/src/main/res/values/styles.xml Description: Override this custom theme in your application's styles.xml to apply custom styling to the Jumio SDK UI on Android. A complete example of customizable values can be found in the DemoApp's styles.xml. ``` -------------------------------- ### Check for Rooted/Jailbroken Device with Jumio SDK Source: https://github.com/jumio/mobile-react/blob/master/README.md This JavaScript snippet demonstrates how to use the `isRooted()` method of the Jumio Mobile SDK to asynchronously check if the device is rooted or jailbroken. ```javascript const isRooted = await JumioMobileSDK.isRooted(); ``` -------------------------------- ### EventResult Data Structure Definition Source: https://github.com/jumio/mobile-react/blob/master/README.md Defines the `EventResult` object, which encapsulates the data extracted from a scanned document. This includes personal information, document details, and location data, providing a comprehensive output from the Jumio scanning process. ```APIDOC EventResult: selectedCountry: String (Max. length: 3) - ISO 3166-1 alpha-3 country code as provided or selected selectedDocumentType: String (Max. length: 16) - PASSPORT, DRIVER_LICENSE, IDENTITY_CARD or VISA selectedDocumentSubType: String - Sub type of the scanned ID idNumber: String (Max. length: 100) - Identification number of the document personalNumber: String - Personal number of the document issuingDate: Date - Date of issue expiryDate: Date - Date of expiry issuingCountry: String (Max. length: 3) - Country of issue as (ISO 3166-1 alpha-3) country code lastName: String (Max. length: 100) - Last name of the customer firstName: String (Max. length: 100) - First name of the customer dob: Date - Date of birth gender: String (Max. length: 1) - m, f or x originatingCountry: String (Max. length: 3) - Country of origin as (ISO 3166-1 alpha-3) country code addressLine: String (Max. length: 64) - Street name city: String (Max. length: 64) - City subdivision: String (Max. length: 3) - Last three characters of ISO 3166-2:US state code postCode: String (Max. length: 15) - Postal code mrzData: MRZ-DATA - MRZ data, see table below optionalData1: String (Max. length: 50) - Optional field of MRZ line 1 optionalData2: String (Max. length: 50) - Optional field of MRZ line 2 placeOfBirth: String (Max. length: 255) - Place of Birth ``` -------------------------------- ### Disable Xcode App Store Distribution Version Management Source: https://github.com/jumio/mobile-react/blob/master/README.md This XML snippet for `exportOptions.plist` disables Xcode's default behavior of managing version and build numbers during App Store distribution. Disabling this is crucial to prevent conflicts with the Jumio SDK's internal version checks, which can lead to crashes. ```XML manageAppVersionAndBuildNumber ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.