React Native integration of the Batch SDK
npm install react-native-batchContributions welcome.
Credit: The push notification parts of this project is based on bamlab's react-native-batch-push package
yarn add react-native-batch
Issues? See the Manual installation section.
javascript
import Batch from 'react-native-batch';Batch.registerForRemoteNotifications();
`See full reference.
Manual installation
Using the installation methods in Getting started section is highly recommended.
However if you run into issues, this section should help troubleshooting.
#### iOS
1. In XCode, in the project navigator, right click
Libraries ➜ Add Files to [your project's name]
2. Go to node_modules ➜ react-native-batch and add RNBatch.xcodeproj
3. In XCode, in the project navigator, select your project. Add libRNBatch.a to your project's Build Phases ➜ Link Binary With Libraries
4. Run your project (Cmd+R)#### Android
1. Open up
android/app/src/main/java/[...]/MainActivity.java
- Add import com.dangerfarms.reactnative.batch.RNBatchPackage; to the imports at the top of the file
- Add new RNBatchPackage() to the list returned by the getPackages() method
2. Append the following lines to android/settings.gradle:
`
include ':react-native-batch'
project(':react-native-batch').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-batch/android')
`
3. Insert the following lines inside the dependencies block in android/app/build.gradle:
`
compile project(':react-native-batch')
``See push setup docs.
See location tracking setup docs
All PRs welcome.
The project is still on progress, so there are no tests, and no linting in place.