This project is an example of how to use the featbit-react-native-sdk.
This is an Expo project created with create-expo-app
.
This example asumes you have a FeatBit environment created which has the following sdkKey
Obg68EqYZk27JTxphPgy7At1aJ8GaAtEaIA1fb3IpuEA.
This environment has the following flags:
{
"id": "robot",
"variation": "AlphaGo",
// variation data type, string will be used if not specified
variationType: VariationDataType.string
},
-
Install dependencies
// In the root folder of the repo npm install && npm run build // In the examples/ExpoApp folder npm install // In the root folder of the repo npm link ./examples/ExpoApp/node_modules/react
-
Start the app
// In the examples/ExpoApp folder npm run start // Then follow the instructions in the terminal to run the app in an emulator or on a physical device.
In the output, you'll find options to open the app in a
- development build
- Android emulator
- iOS simulator
- Expo Go, a limited sandbox for trying out app development with Expo
You can start developing by editing the files inside the app directory. This project uses file-based routing.
if see error: Hooks can only be called inside the body of a function component. just run the following command in the root folder of the repo.
npm link ./examples/ExpoApp/node_modules/react