To comply with privacy requirements like GDPR, you can control when the Pushwoosh SDK communicates with its servers. This ensures no tracking occurs via your main app or the Notification Service Extension (NSE) until you receive explicit user consent.
The Pushwoosh SDK ensures that privacy preferences set in your main app are respected by the Notification Service Extension.
Here is the recommended approach to manage user consent:
1. Disable Communication by Default
To prevent the SDK from sending any data upon app launch, you must disable server communication by default.
In your main app target's Info.plist file, add the following key and set its value to NO:
- Key:
Pushwoosh_ALLOW_SERVER_COMMUNICATION - Type:
Boolean - Value:
NO
This ensures no data is transferred to Pushwoosh servers until you explicitly enable it.
2. Enabling Communication After User Consent
Once the user has given their consent, you need to enable server communication and register the device for push notifications.
// Call this after the user provides consent
Pushwoosh.sharedInstance().startServerCommunication()
Pushwoosh.sharedInstance().registerForPushNotifications()
3. Disabling Communication When Consent is Revoked
If a user revokes their consent, you must stop server communication and unregister the device. Unregistering is a critical step that prevents APNs from delivering any further notifications, which in turn prevents the Notification Service Extension from being triggered.
// Call this after the user revokes consent
Pushwoosh.sharedInstance().stopServerCommunication()
Pushwoosh.sharedInstance().unregisterForPushNotificationsWithCompletion()
By following these steps, you can ensure that no push-related tracking occurs unless the user has actively given their consent.
Comments
0 comments
Please sign in to leave a comment.