Orchestration SDKs

Step 2. Preparing the project

PingOne Advanced Identity Cloud PingAM React Native

After downloading the Orchestration SDKs sample apps repository, you can install the JavaScript dependencies, and prepare the Android and iOS projects in the sample app.

Run all the commands on this page from the sample app’s project root folder, /sdk-sample-apps/reactnative/reactnative-journey.

Installing JavaScript dependencies

To install all dependencies for the project, run the following yarn command:

yarn install

This sample app imports the Orchestration SDK for React Native packages from the npm repository, so there is no separate build step for the SDK itself.

Preparing the native Android project

The Android build requires a debug signing keystore. Generate one by running the keytool utility in the project root (sdk-sample-apps/reactnative/reactnative-journey):

  1. Run keytool to generate the keystore file:

    keytool -genkeypair -v \
      -keystore android/app/debug.keystore \
      -alias androiddebugkey \
      -keyalg RSA -keysize 2048 -validity 10000 \
      -storepass 5tr0ngP@S5w0rd! -keypass 5tr0ngP@S5w0rd! \
      -dname "CN=Android Debug,O=Android,C=US"

    Replace 5tr0ngP@S5w0rd! with a password of your choice, using the same value for both the -storepass and -keypass parameters.

    You must place the generated keystore file at sdk-sample-apps/reactnative/reactnative-journey/android/app/debug.keystore, using the alias androiddebugkey.

    The build will fail if the keystore file is missing, or if the passwords in your Gradle properties do not match those used when generating the keystore.

  2. Add the keystore credentials to your global Gradle properties file, for example at ~/.gradle/gradle.properties.

    KEYSTORE_PASSWORD=5tr0ngP@S5w0rd!
    KEY_PASSWORD=5tr0ngP@S5w0rd!

    By placing the credentials in your global Gradle properties file you reduce the risk of adding the credentials to your source control.

  3. The Android build also requires ANDROID_HOME to be set in your environment.

    If it is not set, create sdk-sample-apps/reactnative/reactnative-journey/android/local.properties containing sdk.dir=/path/to/your/Android/SDK before running the app.

    You can find the Android SDK path in Android Studio under Settings > Languages & Frameworks > Android SDK.

Preparing the native iOS project

After installing JavaScript dependencies, install the iOS native dependencies from the project root (sdk-sample-apps/reactnative/reactnative-journey):

cd ios
bundle install
bundle exec pod install
cd ..

The bundle install command installs the Ruby gems used to manage CocoaPods, and bundle exec pod install installs the native iOS dependencies.

Run bundle exec pod install again from the ios folder after any native dependency changes, or if you encounter unexplained iOS build errors.