Skip to main content

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):

.npmrc
//registry.npmjs.org/:_authToken=YOUR_NPM_TOKEN
Keep the token out of source control

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.

npm install @capacitor/android
npx cap add android
npx cap sync
npx cap open android

3. Configure the project​

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:

android/gradle.properties
androidRepositoryReadOnlyUser=YOUR_USERNAME
androidRepositoryReadOnlyPassword=YOUR_PASSWORD
Keep credentials files out of version control

Troubleshooting​

  • npm install fails with 401 or 404
    Check 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 in Info.plist.

Next step​

Quick start

Initialise the plugin and run your first verification.