ABBYY Mobile Capture React Native Module allows to use the Image Capture feature of ABBYY Mobile Capture in apps based on the React Native framework.
This plugin requires the ABBYY Mobile Capture native libraries which are available for Android and iOS. You can request ABBYY Mobile Capture trial version on the ABBYY website.
The native libraries support the following systems:
Note If you are new to React Native, set up development environment first. You will need yarn
, npx
and cocoapods
(for iOS) utilities. See React Native documentation for details.
Choose one of the following ways to add the module to your project:
yarn add react-native-abbyy-mobile-capture
yarn add file:"Path to react-native-abbyy-mobile-capture sources"
Request ABBYY Mobile Capture trial version on the ABBYY website and add it to your project:
assets
directory to the project into ./assets
folder../assets
with MobileCapture.License
namelibs
directory to the project into ./android/libs
folderlibs
directory to the project into ./ios/libs
folderProceed setup depending on the platform:
gradle
file to the project. Usually it is located at ./android/build.gradle
:
allprojects {
repositories {
flatDir {
dirs "$rootDir/libs"
}
}
}
subprojects {
afterEvaluate {
dependencies {
// Change abbyy-mi-sdk-2.0 to abbyy-rtr-sdk-1.0 if you need to use
recognition API (MI+Extended or MI+ExtendedDC)
implementation(name: 'abbyy-mi-sdk-2.0', ext: 'aar')
implementation(name: 'abbyy-ui-1.0', ext: 'aar')
}
}
}
gradle
file. Usually it is located at ./android/app/build.gradle
:
android {
defaultConfig {
ndk {
// Filter out mips
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
sourceSets {
main {
assets.srcDirs += [ "$rootDir/../assets" ]
}
}
packagingOptions {
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'
}
}
adb
utility to PATH environment variable. adb
is located in Android sdk directory/platform-tools directory
.pod install
from iOS directory.Target
group and open the Build Settings
tab. In the Search Paths
section add to the Framework Search Paths
the following path:
${PROJECT_DIR}/libs
Build Options
tab set Enable Bitcode
option to No.Build Phases
tab. In the Link Binary With Libraries
section, click "+" and add the AbbyyRtrSDK.framework
and AbbyyUI.framework
.Build Phases
, add a new Run Script phase
. Run the copy_frameworks.sh
script that removes the frameworks for the non-active CPU architectures (the complete list depends on the project settings), and sign the resulting framework. This is a required step before uploading your application to App Store.
/bin/sh "${SRCROOT}/libs/copy_frameworks.sh"
Build Phases
add one more Run Script
phase. Run the copy_assets.py
script to automatically copy all resource files to corresponding destinations and add necessary dictionaries.
python "${SRCROOT}/../assets/copy_assets.py"
Build Phases
, go to the Copy Bundle Resources
section and add the MobileCapture.License
file.info.plist
file add permission for working with camera and gallery if necessary.Request ABBYY Mobile Capture trial version on the ABBYY website and add it to your project:
assets
directory to the project into ./assets
folder../assets
with MobileCapture.License
namelibs
directory to the project into ./android/libs
folderlibs
directory to the project into ./ios/libs
folderRun yarn install
from the sample root
Run pod install
from the sample/ios
directory
To run application do the following:
npx react-native run-android
from the sample rootsample/android
projectRun app
buttonnpx react-native run-ios
from the sample root
It runs sample in the simulatorsample/ios
projectRun
buttonSee full documentation on the ABBYY Documentation website.