Skip to content

Latest commit

 

History

History

example

LaunchDarkly React Native SDK example app

Quickstart

  1. At the js-core repo root:
yarn && yarn build
  1. Create an .env file at the same level as this README and add your mobile key to that .env file:
MOBILE_KEY=abcdef12456
  1. Replace my-boolean-flag-1 with your flag key in src/welcome.tsx.

  2. Run the app:

# ios
yarn && yarn ios

# Note: You may need to open the resulting XCode workspace to install the correct target development platform.
# You can use "yarn ios -- --device <device-id or name>" to build for a specific device.
# Note: To use Expo Go instead run "yarn ios-go"

# android
yarn && yarn android

# Note: If you downgrade the React Native or Expo versions used by this example the android build may not work in debug.

Running Detox e2e tests

  1. Install the required tools on OS X:
npm install detox-cli --global
brew tap wix/brew
brew install applesimutils
  1. Detox uses the example app to run tests. The example app needs a mobile key set in an .env file at the same level as this README. Ensure this file exists and add your mobile key to that .env file:
MOBILE_KEY=abcdef12456
  1. For the above mobile key, ensure two boolean flags exist my-boolean-flag-1 and my-boolean-flag-2 and they evaluate to true for test-user. Make sure these flags have client-side SDK availability checked for mobile sdks.

  2. In the example folder, on a terminal:

yarn test