react-native-batch
React Native integration of the Batch SDK for Android and iOS.
Roadmap
- ☑️ Initialize SDK
- ☑️ Configure push notifications
- ☑️ Custom User IDs
- ☑️ Deep linking
- ☑️ Rich notifications (you still need to do some manual integration, actions not supported yet)
- ☑️ Location
- ☑️ Tracking Events
- ☑️ Mobile Landing (with some limitations)
- ☑️ In App messaging (with some limitations)
- ☑️ Get installation ID (for debugging)
- Todo: Inbox support
- Todo: Attributes support
- Todo: Tracking Transactions
- Todo: Write tests
- Todo: Add linting to help contributors
- ...
Contributions welcome.
Credit: The push notification parts of this project is based on bamlab's react-native-batch-push package
Getting started
yarn add react-native-batch
Issues? See the Manual installation section.
Usage
; Batch;
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
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-batch
and addRNBatch.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNBatch.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)
Android
- 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 thegetPackages()
method
- 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')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-batch')
SDK integration and push notification setup
See push setup docs.
Location tracking
See location tracking setup docs
Contributing
All PRs welcome.
The project is still on progress, so there are no tests, and no linting in place.