Sample project using Batch.com platform built with react-native framework.
- Install Node & Watchman
- Install Android Studio and platform dependencies
- Install Xcode and platform dependencies
For more information, please follow the react-native documentation
This sample run on:
- React 17.0.2
- React-native 0.66.2
- Node : 16.2.0
- Run
npm install
from the project root and install the dependencies:
npm install
- Install iOS native dependencies with cocoapods from the ios folder :
cd ios
pod install
- On iOS, look for your
Info.plist
and add the following:
<key>BatchAPIKey</key>
<string>YOUR_BATCH_API_KEY</string>
- On Android, open
android/app/build.gradle
and add:
defaultConfig {
...
resValue "string", "BATCH_API_KEY", "YOUR_BATCH_API_KEY"
}
Add the google-services.json
file to /android/app
If you previously installed a global react-native-cli
package, please remove it and use the built-in command line interface.
You can run the app on simulator using the react-native commands:
For iOS:
npx react-native run-ios
For Android:
npx react-native run-android
Or you can run it on a real device using Xcode or Android Studio (strongly recommended).
- React-Native - The cross-platform framework used
- Batch React-Native Plugin - Batch push provider