Starting with Batch 1.12, you can now opt-out from the SDK.
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:
Important: On iOS, disabling the SDK won't disable push notifications if Batch already has a valid token. In case you want to implement a notification opt-out, you will need to direct users to iOS' settings by using the
[BatchPush openSystemNotificationSettings](Objective-C) ot the
In order to opt-out from SDK, simply call:
Opting out will:
[Batch startWithAPIKey:]from starting the SDK
-[BatchUserDataEditor save]do nothing
Make any "tracking" methods from BatchUser ineffective
Even if you opt-in afterwards, data generated (such as user data or tracked events) while opted out WILL be lost.
You can also wipe the local SDK data:
Remote data will not be wiped. To do so, please make a separate deletion request.
Note: Opting out is not possible while the SDK hasn't started. Make sure you've called
In order to disable the SDK by default, you need to add a key called
BATCH_OPTED_OUT_BY_DEFAULT with a
true boolean value to your Info.plist.
Once you've opted-out (either programatically, or by default), you can re-enable the SDK by calling the following:
[Batch optIn]; [Batch startWithAPIKey:@"YOUR_API_KEY"];
Batch.optIn() Batch.start(withAPIKey: "YOUR_API_KEY")
Note: Even if you've already done so before opting-out, you are required to call
[Batch startWithAPIKey:]or the SDK won't work until the next start.