Skip to main content

Installation

MPP React Native provides functionality for Push Provisioning support.

Requirements

Android

  • Google Pay

    • Agreement with Google granting permission to use the Google Pay API for Push Provisioning.
    • Whitelisted app package name and SHA-256 certificate fingerprint by Google.
    • Android version must be 5.0 (Lollipop) or above.
  • Samsung Pay

    • Agreement with Samsung granting permission to use the Samsung Pay API for Push Provisioning.
    • Registered app in Samsung Pay Developer portal.
  • Android version must be 5.1 (Lollipop, API level 22) or above.

  • Device must be able to connect to the Internet.

iOS

  • Agreement with Apple.
  • App Store app whitelisted by Apple.
  • iOS version must be 11.0 or above.
  • Device must be able to connect to the Internet.
  • Apple Pay might not be supported on Jailbroken devices.

Installation

Set npm configuration for private package.

npm config set @meawallet:registry=https://nexus.ext.meawallet.com/repository/react-native-mpp/
npm config set //nexus.ext.meawallet.com/repository/react-native-mpp/:username NEXUS_USER
npm config set //nexus.ext.meawallet.com/repository/react-native-mpp/:_password $(echo -n 'NEXUS_PASSWORD' | base64)

Install react-native-mpp package with npm.

npm install @meawallet/react-native-mpp --save

Linking Libraries

Usually react-native-mpp is linked with autolinking, however some project setup might affect and disable autolinking, then the library should be linked manually.

Android

In android/app/src/main/java/com/example/app/MainApplication.java add the following:

  • Import MppPackage:
import com.reactnativempp.MppPackage;
  • Add the package in getPackages() function:
@Override
protected List<ReactPackage> getPackages() {
...
packages.add(new MppPackage());
return packages;
}

Xcode

See React Native iOS - Manual linking.

Configuration

Configuration File

  1. Download mea_config.<issuer>.zip.

  2. Unzip the archive. Archive contains configuration file mea_config.

  3. Depending on your platform:

    • Android: Add mea_config to Android App resources res/raw folder. Library automatically loads configuration from app bundle during runtime, and throws an exception if configuration file is missing, broken or otherwise fails to load.
    • iOS: Add mea_config to iOS App Resources folder and App Target. File must be included in the final app bundle. Framework automatically loads configuration from app bundle during runtime.

Environments

  • test - test environment
  • prod - production environment

By default test environment is set. After npm install set environment variable npm_config_mpp_env to switch between test and prod environments:

export npm_config_mpp_env=prod

Android (Android Studio)

If npm_config_mpp_env environment variable does not work as expected, mpp_env can be set in build.gradle of the Android project.

  1. Open android/build.gradle in your React Native project folder.
  2. Set mpp_env property in buildscript block at the top of the build.gradle file:
buildscript {
ext {
...
mpp_env = "prod"
...
}
...
}

iOS (Xcode)

After switching environment run Product - Clean Build Folder in Xcode or the following xcodebuild command.

xcodebuild -project App.xcodeproj -target App clean

Then run a command to install Pods and select "Read From Disk" if Xcode prompts.

cd ios && npm exec -c 'pod install'

Build Pipelines

Some build pipelines or build chains (e.g. appcenter, fastlane) require to set the environment variable npm_config_mpp_env explicitly. Refer to respective build tool documentation.

Enabling Issuer App for Push Provisioning

Android

Refer to MPP Android documentation.

iOS

Refer to MPP iOS documentation.