Opt In to Batch SDK Usage.
This method will be taken into account on next full application start (full process restart)
Only useful if you called batch.optOut() or batch.optOutAndWipeData() or opted out by default in the manifest
Some features might not be disabled until the next app start if you call this late into the application's life. It is strongly advised to restart the application (or at least the current activity) after opting in.
Opt Out from Batch SDK Usage
Note that calling the SDK when opted out is discouraged: Some modules might behave unexpectedly when the SDK is opted-out from.
Opting out will:
Even if you opt in afterwards, data that has been generated while opted out WILL be lost.
If you're also looking at deleting user data, please use batch.optOutAndWipeData()
Note that calling this method will stop Batch. Your app should be prepared to handle these cases. Some features might not be disabled until the next app start.
Opt Out from Batch SDK Usage
Same as batch.optOut(Context) but also wipes data.
Note that calling this method will stop Batch. Your app should be prepared to handle these cases.
Shows debug view
Batch's inbox module
Gets a Batch inbox fetcher.
Disables do not disturb mode and shows the currently enqueued message, if any.
(iOS only)
(iOS only)
Define if incoming messages have to be enqueued or displayed directly
Shows the currently enqueued message, if any.
Listen for messaging events
Batch's push module
Clear the app badge on iOS. No effect on Android.
Dismiss the app's shown notifications on iOS. Should be called on startup.
No effect on Android.
Gets the app's initial URL.
On iOS, make sure to call this only once (only the first call will return something, if Linking.getInitialURL doesn't return anything)
Gets the last known push token. Batch MUST be started in order to use this method.
The returned token might be outdated and invalid if this method is called too early in your application lifecycle.
On iOS, your application should still register for remote notifications once per launch, in order to keep this value valid.
Synchronizes the user's iOS token with Batch. Should be called at each app launch.
No effect on Android.
Ask iOS users if they want to accept push notifications. Required to be able to push users.
No effect on Android.
Ask iOS users if they want to accept push notifications. Required to be able to push users (or use requestProvisionalNotificationAuthorization).
No effect on Android.
Ask iOS for provisional notifications (no alert to users). Required to be able to push users (or use requestNotificationAuthorization).
No effect on Android.
Change the used remote notification types on Android. (Ex: sound, vibrate, alert)
Does not work with iOS
Example : setAndroidNotificationTypes(batch.push.AndroidNotificationTypes.ALERT | batch.push.AndroidNotificationTypes.SOUND)
Listen for push events
dismiss and display are only supported on Android (you can still call addListener on those but it's a no-op).
Push payload will vary depending on the platform.
Batch's user module
Creates an editor for the user profile
The profile is not updated until the method save()
is called
Get the unique installation ID, generated by Batch. Batch must be started to read it. You will get the result in a promise.
Track an event. Batch must be started at some point, or events won't be sent to the server.
The event name. Must be a string.
The event label (optional). Must be a string.
The event data (optional). Must be an object.
Track a geolocation update You can call this method from any thread. Batch must be started at some point, or location updates won't be sent to the server.
User location object
Track a transaction. Batch must be started at some point, or events won't be sent to the server.
Transaction's amount.
The transaction data (optional). Must be an object.
Generated using TypeDoc
Batch React-Native Module