react-native-abbyy-mobile-capture-sample-ui-imagecapture v1.0.2
ABBYY Mobile Capture React Native Module
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:
- Android version: 5.0 or later for ARMv7 (armeabi-v7a), ARMv8 (arm64-v8a), x86 and x86_64 processors
- iOS: versions 11.x and later
Getting started
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:
From npm:
yarn add react-native-abbyy-mobile-captureFrom sources:
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:
- Copy iOS
assetsdirectory to the project into./assetsfolder. - Copy your license into
./assetswithMobileCapture.Licensename - Copy Android
libsdirectory to the project into./android/libsfolder - Copy iOS
libsdirectory to the project into./ios/libsfolder
- Copy iOS
Proceed setup depending on the platform:
- Android:
- Add
gradlefile 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') } } } - Add to application
gradlefile. 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' } } - Set minimum SDK version to '21'.
- Add
adbutility to PATH environment variable.adbis located inAndroid sdk directory/platform-tools directory.
- Add
- iOS:
- Run
pod installfrom iOS directory. - Select your project in the
Targetgroup and open theBuild Settingstab. In theSearch Pathssection add to theFramework Search Pathsthe following path:${PROJECT_DIR}/libs - On the
Build Optionstab setEnable Bitcodeoption to No. - Open the
Build Phasestab. In theLink Binary With Librariessection, click "+" and add theAbbyyRtrSDK.frameworkandAbbyyUI.framework. - In
Build Phases, add a newRun Script phase. Run thecopy_frameworks.shscript 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" - To add the resource files and set up the copying rules, in
Build Phasesadd one moreRun Scriptphase. Run thecopy_assets.pyscript to automatically copy all resource files to corresponding destinations and add necessary dictionaries.python "${SRCROOT}/../assets/copy_assets.py" - In
Build Phases, go to theCopy Bundle Resourcessection and add theMobileCapture.Licensefile. In the
info.plistfile add permission for working with camera and gallery if necessary.
- Run
- Android:
ABBYY Mobile Capture React Native Module Example
How to run samples
Request ABBYY Mobile Capture trial version on the ABBYY website and add it to your project:
- Copy iOS
assetsdirectory to the project into./assetsfolder. - Copy your license into
./assetswithMobileCapture.Licensename - Copy Android
libsdirectory to the project into./android/libsfolder - Copy iOS
libsdirectory to the project into./ios/libsfolder
- Copy iOS
Run
yarn installfrom the sample rootRun
pod installfrom thesample/iosdirectoryTo run application do the following:
- Android:
- From console:
- Execute
npx react-native run-androidfrom the sample root
- Execute
- From Android Studio:
- Open
sample/androidproject - Click
Run appbutton
- Open
- From console:
- iOS:
- From console:
- Execute
npx react-native run-iosfrom the sample root It runs sample in the simulator
- Execute
- From XCode
- Open
sample/iosproject - Click
Runbutton
- Open
- From console:
- Android:
Documentation
See full documentation on the ABBYY Documentation website.
6 years ago