To comply with privacy regulations like GDPR, you can configure the Pushwoosh SDK to be disabled by default and only enable communication and tracking after receiving explicit user consent. This requires using version 2.3.14 or newer of the pushwoosh-flutter plugin.
Here is the step-by-step process:
1. Disable Server Communication by Default
First, you need to prevent the SDK from communicating with Pushwoosh servers when the app starts. This is done by adding a configuration flag to the native part of your project.
For Android: In your
AndroidManifest.xmlfile, add the following meta-data tag within the<application>tag:<meta-data android:name="com.pushwoosh.allow_server_communication" android:value="false" />For iOS: In your
Info.plistfile, add the following key:- Key:
Pushwoosh_ALLOW_SERVER_COMMUNICATION - Type:
Boolean - Value:
NO
- Key:
2. Enable Communication After User Consent (Opt-In)
When a user provides their consent within your app, you must explicitly start server communication and then register the device for push notifications.
// When user opts-in
// 1. Start communication with Pushwoosh servers
Pushwoosh.getInstance().startServerCommunication();
// 2. Register the device for push notifications
Pushwoosh.getInstance().registerForPushNotifications();
3. Disable Communication if Consent is Revoked (Opt-Out)
If a user decides to withdraw their consent, you must unregister their device first before stopping server communication. This ensures the unregistration request is successfully sent.
// When user opts-out
// 1. Unregister the device from push notifications
Pushwoosh.getInstance().unregisterForPushNotifications();
// 2. After the device is unregistered, stop all communication
// It's recommended to wait for the unregister callback to complete before calling this.
Pushwoosh.getInstance().stopServerCommunication();
Comments
0 comments
Please sign in to leave a comment.