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, |
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):
-
Run
keytoolto 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
-storepassand-keypassparameters.You must place the generated keystore file at
sdk-sample-apps/reactnative/reactnative-journey/android/app/debug.keystore, using the aliasandroiddebugkey.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.
-
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.
-
The Android build also requires
ANDROID_HOMEto be set in your environment.If it is not set, create
sdk-sample-apps/reactnative/reactnative-journey/android/local.propertiescontainingsdk.dir=/path/to/your/Android/SDKbefore 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 |