If you plan to send personal user data and have to comply with EU's GDPR, any other data privacy law or simply want to give your users more control regarding their privacy, these methods will help you plug your consent screen to Batch.
There are two SDK operation modes:
SDK enabled by default, opting-out required via an explicit method call: this is the default mode.
SDK disabled by default, opting-in required
On iOS, disabling the SDK won't disable push notifications if Batch already has a valid token.
In order to opt-out from SDK, simply call:
Opting out will:
Prevent Batch from starting
Disable any network capability from the SDK
Disable all In-App campaigns
Make the Inbox module return an error immediately
You can also wipe the SDK installation data:
This will wipe the data locally and request a remote data removal for the matching Installation ID and its associated data. Any user-level data associated with the Custom User ID (if any) set via our server APIs will not be deleted. However, the Installation ID <> Custom User ID association will be, effectively logging the user out before deleting their installation data. Sending notifications to this user using their Advertising ID (via the Transactional API or a Custom Audience) will not be possible for a month.
In order to disable the SDK by default, you will need to modify your Info.plist or AndroidManifest.xml:
On iOS, you need to add a key called BATCH_OPTED_OUT_BY_DEFAULT with a true boolean value to your Info.plist.
On Android, please add a meta-data entry to your AndroidManifest's <application> tag:
Once you've opted-out (either programmatically, or by default), you can re-enable the SDK by calling the following:
If you need to know whether your users are opted-out from the sdk you can use:
BatchProfileAttributeEditor.save() do nothingMake any trackEvent methods from BatchProfile ineffective
await Batch.instance.optOut()await Batch.instance.optOutAndWipeData()<meta-data android:name="batch_opted_out_by_default" android:value="true" />Batch.instance.optIn()await Batch.instance.isOptedOut()By default, the Batch SDK will automatically collect some data related to the user's device, please visit the native sections for more info on Android and iOS.
Some of this data are disabled by default and can be toggled on/off according to the user consent:
Device model
Device brand (Android only)
GeoIP
Use the following API to fine-tune what you want to enable:
Batch.instance.setAutomaticDataCollection({
"geoIP": true, // Enable GeoIP resolution on server side
"deviceBrand": true, // Enable automatic collection of the device brand information (Android only)
"deviceModel": true, // Enable automatic collection of the device model information
});