Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

vgs-samples/vgs-collect-show-android-react-native-demo

Repository files navigation

NOTE: Check our new ReactNative Demo App with VGS Collect and VGS Show SDKs here.

VGS Collect/Show SDK. React Native Demo.

NOTE: This demo is just an example of how VGS Collect SDK and VGS Show SDK can be integrated into your application.

How to run it?

Step 1

Go to your VGS organization and establish Inbound connection. For this demo you can import pre-built route configuration:

  • Find the configuration.yaml file inside the app repository and download it.
  • Go to the Routes section on the Dashboard page and select the Inbound tab.
  • Press Manage button at the right corner and select Import YAML file.
  • Choose configuration.yaml file that you just downloaded and tap on Save button to save the route.

Step 2

git clone git@github.com:vgs-samples/vgs-collect-show-android-react-native-demo.git

Step 3

NOTE: Please visit React Native documentation for more detailed explanation how to setup environment.

Specify Android SDK directory

Create local.properties file in ~/vgs-collect-show-android-react-native-demo/android folder and specify sdk.dir property.

## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=<ANDROID_SDK_DIRECTORY_PATH>

Step 4

Setup "<VAULT_ID>".

VGS Collect SDK. Find VGSCollectModule.java and replace VAULT_ID constant with your vault id.

VGS Show SDK. Find VGSShowModule.java and replace VAULT_ID constant with your vault id.

Step 5

NOTE: Please visit React Native documentation to read how to run the application on a device.

Running the project with script

This step is not mandatory but helpful.

You could use script to make integration process faster. The script helps to avoid some popular issues and run application on a device.

  • Open a Terminal and go to the project directory.
  • If this is first start - run npm install command.
  • Run npx react-native run-android

Step 6

Submit and reveal the form then go to the Logs tab on a Dashboard, find a request and secure a payload. Instruction for this step you can find here.