This is a new React Native project, bootstrapped using @react-native-community/cli.
See docs/ad-setup.md for including the configured ad ID to your local environment before starting up.
npm install --include=dev
To initialize the firebase SDK for respective stages, the google-services.json and GoogleServices-Info.plist files are requried for android and iOS respectively.
- Download the service configurations from the Firebase console for each stage
- For Android, place each in the following
dev-pr google-services.json > ./android/app/src/local/google-services.json > .google-services/android/dev-pr-google-services.json dev-pr google-services.json > ./android/app/src/lan/google-services.json > ./google-services/android/dev-pr-google-services.json dev-pr google-services.json > ./android/app/src/devpr/google-services.json > ./google-services/android/dev-pr-google-services.json staging google-services.json > ./android/app/src/staging/google-services.json > ./google-services/android/staging-google-services.json production google-services.json > ./android/app/src/local/google-services.json > ./google-services/android/production-google-services.json - For iOS, place each in the following
dev-pr GoogleServices-Info.plist > .google-services/ios/dev-prGoogleServices-Info.plist dev-pr GoogleServices-Info.plist > ./google-services/ios/dev-prGoogleServices-Info.plist dev-pr GoogleServices-Info.plist > ./google-services/ios/dev-prGoogleServices-Info.plist staging GoogleServices-Info.plist > ./google-services/ios/stagingGoogleServices-Info.plist production GoogleServices-Info.plist > ./google-services/ios/productionGoogleServices-Info.plist
First, you will need to start Metro, the JavaScript bundler that ships with React Native.
To start Metro, run the following command from the root of your React Native project:
# using npm
npm startLet Metro Bundler run in its own terminal. Open a new terminal from the root of your React Native project. Run the following command to start your Android or iOS app:
# using npm
npm run android# using npm
npm run iosIf everything is set up correctly, you should see your new app running in your Android Emulator or iOS Simulator shortly provided you have set up your emulator/simulator correctly.
This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.
Different API endpoints are used based on the run environment. To run the application on your desired environment:
npm run ios:<ENV>
# or
npm run android:<ENV>Alternatively, you can select a scheme and device to run on from Xcode.
See the package.json scripts for available environments.