Installation

Add the Bridge to the Project

First, add the following snippet to your project root /.npmrc file (create the file if it doesn’t exist yet). This will inform your npm/yarn installation to search in the correct location for our packages.

@sensibill:registry=https://npm.pkg.github.com

Now, add the bridge to your project using the dependency manager of your choice.

With Yarn:

yarn add @sensibill/reactnative-bridge-sdk@2023.0.2

With Npm:

npm install --save @sensibill/reactnative-bridge-sdk@2023.0.2

Configure Applications (Platform-Specific)

Once the bridge is added to the project, configure the iOS and Android applications, as explained below.

Adding Sensibill SDK and Bridge to the Application

  1. Add the Sensibill SDK for iOS as a dependency to your project’s Podfile in the following format:

    pod 'Sensibill', :git => 'git@github.com:getsensibill/sdk-ios.git', :tag => 'vX.Y.Z'

    where vX.Y.Z corresponds to the version of the SDK specified in the sensibill-reactnative-bridge-sdk.podspec file.

  2. Run pod install from the root directory of your application’s project in your terminal. This will add the Sensibill SDK for iOS, as well as the bridge to your project’s Pods.

Installation Validation

  • Open your application’s workspace in Xcode, and ensure that the sensibill-reactnative-bridge-sdk is listed in the Development Pods, and Sensibill SDK is includes in Pods section of the Pods.

  • Build the project using your regular method to ensure it compiles successfully.

    Note: the sensibill-reactnative-bridge-sdk’s podspec assumes that Sensibill SDK can be located at $(PODS_ROOT)/Sensibill/Sensibill/ folder in your application. If this is not the case, the build will fail with the error: “Module ‘Sensibill’ was not found”. In such case, adjust FRAMEWORK_SEARCH_PATHS of the sensibill-reactnative-bridge-sdk to include a location where Sensibill SDK can be found. The location must be included either using a “recursively” flag, or using the .../Sensibill/Sensibill/** notation.

Adding Entitlements

  • When a user navigates to the Capture Receipt screen of the Sensibill SDK, the SDK will use device’s camera to capture receipts. In order to allow camera usage, your application must prompt the user for consent to use their device’s camera, and thus requires a Privacy - Camera Usage Description entitlement.

  • By default, the enableImageGallery feature flag is set to true, which allows the Sensibill SDK to select existing receipt images from the device’s photo gallery. To allow this functionality, add the Privacy - Photo Library Usage Description entitlement. Otherwise, set the enableImageGallery feature flag to false.

  • If you plan to enable the attachLocationData feature flag to attach the location where the receipts were taken, the Privacy - Location When In Use Usage Description entitlement is required. By default the attachLocationData flag is disabled.

    Note: While the Sensibill SDK will ask for Camera and Photo Gallery permissions when they are required, the “Location When In Use” permission must be requested by your app prior to starting the Capture. See Reading Exif Data section of the Usage page for more information.

Some extra steps are required to install the Android component of the Bridge & SDK. Namely, that the main Native Sensibill SDK dependency must be properly resolved so it can be referenced by the bridge. The Android Sensibill SDK is hosted on Sensibill’s own Maven repository, so access to that repository must be given to the Android subproject so the dependency can be resolved.

Add Sensibill Maven To add Sensibill’s Maven server to the list of android repositories, the below maven block must be added to the app’s repositories block of the appropriate build.gradle file.

Info

Reach out to Sensibill’s Support team in order to be provided valid credentials to access the Sensibill Maven artifacts.

// (1)
repositories {
  // Other repositories...

  maven {
    url 'https://maven.pkg.github.com/getsensibill/sdk-android'
    credentials {
      username 'PROVIDED BY SENSIBILL'
      password 'PROVIDED BY SENSIBILL'
    }
  }
}

// (2) or...
allprojects {
  repositories {
    // Other repositories...

    maven {
      url 'https://maven.pkg.github.com/getsensibill/sdk-android'
      credentials {
        username 'PROVIDED BY SENSIBILL'
        password 'PROVIDED BY SENSIBILL'
      }
    }
  }
}

Depending on project setup, the appropriate build.gradle file is likely in one of two places:

IF you have two build.gradle files, one at /android/build.gradle and one at /android/app/build.gradle: You’ll need to add the (2) block to the /android/build.gradle file.

  • If the allprojects.repositories block already exists, add the above maven block to it.
  • If the allprojects block already exists, add the above repositories block to it.
  • If the allprojects block doesn’t exist, paste in exactly what is above in section (2).

IF you have one build.gradle file, existing at /android/build.gradle: You’ll need to add the (1) block to the /android/build.gradle file.

  • Find the top level repositories block (not the one in the buildscript block). If it doesn’t exist, create one above the top level dependencies block.
  • Paste the maven block above to add the Sensibill Maven repository