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
Configuration
Configuration File
Download
mea_config.<issuer>.zip
.Unzip the archive. Archive contains configuration file
mea_config
.Depending on your platform:
- Android:
Add
mea_config
to Android App resourcesres/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 AppResources
folder and App Target. File must be included in the final app bundle. Framework automatically loads configuration from app bundle during runtime.
- Android:
Add
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.
- Open
android/build.gradle
in your React Native project folder. - Set
mpp_env
property inbuildscript
block at the top of thebuild.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.