Installation
The MobbScan plugin brings the native Android and iOS SDKs to Capacitor apps built with Angular, React or Vue. It is distributed through npm with a private access token provided by Mobbeel.
1. Add the token
Add the token to the .npmrc file at the root of your project (create it if it does not exist):
//registry.npmjs.org/:_authToken=YOUR_NPM_TOKEN
2. Install the plugin
The plugin is compatible with Capacitor and Apache Cordova.
npm install @mobbeel/mobbscan-cordova-plugin
The installation downloads the native iOS SDK and may take a few minutes.
If your app does not have the native projects yet, add them:
Install @capacitor/android and @capacitor/ios at the same version as @capacitor/core in your project.
- Android
- iOS
npm install @capacitor/android
npx cap add android
npx cap sync
npx cap open android
npm install @capacitor/ios
npx cap add ios
cd ios/App && pod install && cd ../..
npx cap sync
npx cap open ios
3. Configure the project
- Android
- iOS
The plugin resolves the Android SDK from Mobbeel's Maven repository (repository.mobbeel.com). Add the credentials provided by Mobbeel to android/gradle.properties or android/local.properties:
androidRepositoryReadOnlyUser=YOUR_USERNAME
androidRepositoryReadOnlyPassword=YOUR_PASSWORD
Add the usage descriptions to ios/App/App/Info.plist:
<key>NSCameraUsageDescription</key>
<string>The camera is used to scan your identity document and take a selfie.</string>
Troubleshooting
npm installfails with 401 or 404Check the token in.npmrc. Contact Mobbeel if you do not have one.The app closes when the camera opens on iOS
Declare the usage descriptions inInfo.plist.