Install Mobbscan React Native SDK
Requirements
License
A license key bounded to your application is needed to start using the SDK. Please, contact with us to obtain one.
React Native
Warning!": React Native versions older than 0.60 are just supported from the MobbScan plugin version v2.19.2.
Android
- Minimum SDK Version:
19
. - Do not have
android:allowBackup
configured (neithertrue
orfalse
)
Tooling
wget
npm
Node
- Node 10
- An NPM auth token is needed to access our repositories. If you do not have one, please contact us.
NOTE: Several versions of Node can be installed in the same machine using nvm. Once it is installed you can install Node 10 by executing the following:
$ nvm install 10 $ nvm use 10
How to add the plugin to an existing project
Check all the previous requisites.
Add the following line in your
.npmrc
file in the root of your project (if it does not exist, just create it empty):
//registry.npmjs.org/:_authToken=the-provided-token
- Type the following in the root of your terminal
$ npm install --save @mobbeel/react-native-mobbscan
- Type the following:
$ npx react-native link @mobbeel/react-native-mobbscan
- In your
android/app/build.gradle
file, add the following line:
apply from: "../../node_modules/@mobbeel/react-native-mobbscan/build-extension.gradle"
- MobbScan plugin is ready to be used!
IDE configurations
XCode
If you are using React Native versions newer than v0.60, you must navigate to your iOS project folder and execute the command Pod install
in order to install all the MobbScan dependencies. These React Native versions are just supported from version v2.19.2 of the MobbScan plugin.
IMPORTANT: Last XCode versions does not work well with React Native versions less than 0.59.9 (issue).
For plugin versions older than v2.19.2, please follow these steps:
If you want to run the project using XCode some extra steps are needed:
- Drop in the XCode Project Navigator (left sidebar) the following frameworks in
node_modules/@mobbeel/react-native-mobbscan/ios/libs
:
MobbCommons.xcframework
MobbIDSDK_Core.xcframework
MobbIDSDK_Face.xcframework
MobbScan_MobbIDFaceValidator_iOS.xcframework
MobbScanSDK.xcframework
protobuf_lite_ios.xcframework
Select the "Create group" option when requested and uncheck the Copy items if needed
if it is checked.
In the Project Navigator, select your project, and go to
General -> MobbScanDemo Target -> Frameworks, Libraries, and Embedded Content
. There select the "Embed & Sign" option for the following libraries:MobbCommons.xcframework
MobbScanSDK.xcframework
MobbScan_MobbIDFaceValidator_iOS.xcframework
MobbIDSDK_Core.xcframework
MobbIDSDK_Face.xcframework
protobuf_lite_ios.xcframework
In your Project Settings, search for
Framework Search Paths
under the Build Settings an add this path with theRecursive
option enabled:
../node_modules/@mobbeel/react-native-mobbscan/ios/libs
- That's it!
Android
From version v2.19.0, androidx
is included inside the plugin. If your project uses the old android support libraries, you should take a look on the Android migration guide..