LogoLogo
Useful links
  • Home
  • Product guides
  • API
  • SDKs
  • Overview
  • First steps
  • ANDROID
    • Getting Started with the SDK
    • Standalone Modules
      • Document Detector
        • Release Notes
        • Current Version
        • Requirements
        • Gradle Dependencies
        • Gradle Source Code
        • Setting up the SDK
          • Setting properties
          • Capture Stages
          • Messages Settings
          • Customization
          • Security Settings
          • Detection Steps
          • Upload Mode
          • Advanced Settings
            • Proxy configuration
            • Preview configuration
        • Start Document Detection
        • Source Code
        • Google security form
        • Reduce SDKs size
        • SDKs response
        • References
        • FAQ
      • Face Liveness
        • Release Notes
        • Current Version
        • Requirements
        • Gradle Dependencies
        • Gradle Source Code
        • SDK Lifecycle
        • Building the SDK
        • Start Liveness Verification
        • Source Code
        • References
        • Advanced Features
        • FAQ
      • Face Authenticator
        • Release Notes
      • Smart Auth
        • Release Notes
        • Current Version
        • Requirements
        • Gradle Dependencies
        • Gradle Source Code
        • Permissions
        • SDK Lifecycle
        • Building the SDK
        • Start Smart Authentication
        • Source Code
        • References
        • FAQ
      • Face Liveness (deprecated)
        • Release Notes
  • iOS
    • Getting Started with the SDK
    • Standalone Modules
      • Document Detector
        • Release Notes
        • Current Version
        • Requirements
        • Installing the SDK
        • Setting up the SDK
          • Setting properties
          • Messages Settings
          • Customization
          • Detection Steps
          • Upload Mode
          • Advanced Settings
            • Proxy configuration
            • Preview configuration
        • Start Document Detection
        • References
        • FAQ
      • Face Liveness
        • Release Notes
        • Installation
        • Current Version
        • Requirements
        • SDK Lifecycle
        • Building the SDK
        • Start Liveness Verification
        • Source Code
        • References
        • FAQ
      • Face Authenticator
        • Release Notes
        • Installation
        • Current Version
        • Requirements
        • Building the SDK
        • Start the SDK
        • References
        • FAQ
      • Smart Auth
        • Release Notes
        • Installation
        • Current Version
        • Requirements
        • SDK Lifecycle
        • Building the SDK
        • Start Smart Authentication
        • Source Code
        • References
        • FAQ
      • Face Liveness (deprecated)
        • Release Notes
  • REACT NATIVE
    • Standalone Modules
      • Document Detector
        • Release Notes
        • Current Version
        • Requirements
        • Installation
        • Hooks
        • Start Document Verification
        • Source Code
        • TypeScript References
        • Customizing Style
        • FAQ
      • Face Liveness
        • Release Notes
        • Current Version
        • Requirements
        • Installation
        • Hooks
        • Start Liveness Verification
        • Source Code
        • TypeScript References
        • FAQ
      • Face Authenticator
        • Release Notes
        • Current Version
        • Requirements
        • Installation
        • Hooks
        • Start Authentication Verification
        • Source Code
        • TypeScript References
        • FAQ
      • Smart Auth
        • Getting started
        • Release notes
        • Using Native Modules
          • Requirements
          • Gradle Source Code
          • Podfile Source Code
          • Native Module Android
          • Native Module iOS
          • Import Native Modules
          • Source Code
          • TypeScript References
          • FAQ
        • Using Expo Modules
          • Requirements
          • Create Local Expo Module
          • Gradle Source Code
          • Podspec Source Code
          • Native Module Android
          • Native Module iOS
          • Import Expo Modules
          • Source Code
          • TypeScript References
          • FAQ
  • WEB (JAVASCRIPT)
    • Standalone Modules
      • Document Detector
        • Getting started
        • SDK builder options
          • Analytics
          • Appearance
          • Messages
        • SDK methods
        • Event listeners
        • Customization
        • Release notes
      • Face Liveness
        • Customization
        • Release notes
      • Face Authenticator
        • Customization
        • Release notes
      • Smart Auth
        • SDK errors
        • Customization
        • Release notes
LogoLogo

2025 © Caf. - All rights reserved

On this page
  • Android
  • iOS
  • Calling the application codes
  1. REACT NATIVE
  2. Standalone Modules
  3. Smart Auth

Getting started

This page presents the first steps to using the Identity SDK for React Native.

Last updated 1 month ago

All integration will be based on files already present in the .

For security reasons, our repository is private, if you want to perform the integration with the product, please contact the person responsible for your service.

Android

  1. Copy the files CombateAFraudeModule.java and CombateAFraudePackage.java, located in the example repository in the path SDKsExample/android/app/src/main/java/com/sdksexample/ **** to the folder **** <root-project>/android/app/src/main/java/com/<your-package-name> in your project.

Note: the function getName will be used to call the method on the React Native side; The method annotated with @ReactMethod will be used for the calls on the React Native side.

2. Reference the module in your MainApplication.java

import com.<your-package-name>;

private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
    ...
    packages.add(new CombateAFraudePackage());
    ...
}

3. In the <root-project>/android/build.gradle file add our Maven repository and the minSdkVersion setting for at least API 21:

buildscript {
    ext {
        minSdkVersion = 21
    }
}

allprojects {
    repositories {
        maven { url "https://repo.combateafraude.com/android/release" }
    }
}

4. In the <root-project>/android/app/build.gradle file add our project settings:

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    aaptOptions {
        noCompress "tflite"
    }

    dataBinding {
        enabled = true
    }
}

5. In the same file, add the Identity dependencies:

dependencies {
    implementation 'com.combateafraude.sdk:identity:<sdk_version>'
}

6. Update the dependencies by running the following commands:

cd android
./gradlew clean bundleRelease
./gradlew build --refresh-dependencies

Note: Check that you are running Java version 1.8. If not, run it:

export JAVA_HOME=`/usr/libexec/java_home -v 1.8`

iOS

  1. In the <root-project>/ios/Podfile, make sure the minimum iOS version is 12.4+, add the line use_frameworks! and disable Flipper:

platform :ios, '12.4'
use_frameworks!

target '<app-name>' do
 ...
 # Note that if you have use_frameworks! enabled, Flipper will not work and
 # you should disable these next few lines.
 # use_flipper!
 # post_install do |installer|
 #   flipper_post_install(installer)
 # end
end

target '<app-name>-tvOS' do
 ...
end

source 'https://github.com/combateafraude/iOS.git'
source 'https://cdn.cocoapods.org/'

2. In the same file, add the iOS SDKs you want to use:

target '<app-name>' do
 pod 'Identity', '~> <version>'
end

3. Run the command cd ios && pod install && cd .. to install the dependencies

4. Copy the SDKsExample-Bridging-Header.h, CombateAFraude.m and CombateAFraude.swift files, located in the repository in the **SDKsExample/ios ** path, to the <root-project>/ios folder

5. In case you have any issues running the project after completing all the steps, add this code line in your Podfile and run the command cd ios && pod install && cd ..

post_install do |installer|
  fix_deployment_target(installer)
  enable_bitcode(installer)
end

# This resolves any possible deployment issue by making sure it is the same as the project
def fix_deployment_target(installer)
  return if !installer
  project = installer.pods_project
  project_deployment_target = project.build_configurations.first.build_settings['IPHONEOS_DEPLOYMENT_TARGET']

  puts "Make sure all pods deployment target is #{project_deployment_target.green}"
  project.targets.each do |target|
    puts "  #{target.name}".blue
    target.build_configurations.each do |config|
      old_target = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET']
      new_target = project_deployment_target
      next if old_target == new_target
      puts "    #{config.name}: #{old_target.yellow} -> #{new_target.green}"
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = new_target
    end
  end
end

def enable_bitcode(installer)
  return if !installer
  installer.pods_project.build_configurations.each do |config|
    # config.build_settings['ENABLE_BITCODE'] = 'YES'
    # config.build_settings['OTHER_CFLAGS'] = '-fembed-bitcode'
    # config.build_settings['BITCODE_GENERATION_MODE'] = 'bitcode'
    config.build_settings['DEAD_CODE_STRIPPING'] = 'YES'
    config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
  end
end

Calling the application codes

The App.js file in the example repository shows how to call these methods and access their results.

sample repository