Require User Privacy Consent
By default, your app will automatically send device data to OneSignal prior to requesting push notification consent. This includes obtaining a oneSignalUserId which can be used to associate the device and user. To facilitate GDPR compliance, you may set this to manual which will defer sending device data until you obtain consent from the user. You must then use the JavaScript Bridge to confirm consent has been granted and begin transmitting data.
To request explicit consent from the user before any device data is sent to OneSignal, set the Require user privacy consent before transmitting data setting to Enable and then use the Median JavaScript Bridge to grant and revoke consent. Once consent has been granted, the device will initialize with OneSignal and a oneSignalUserId
will be assigned and sent to the device.
βοΈMedian JavaScript Bridge
To grant privacy consent, run the following command. If Automatic Registration is not Disabled (see Auto Register), the push notification permission prompt will then be displayed to the user.
median.onesignal.userPrivacyConsent.grant();
<a onclick="median.onesignal.userPrivacyConsent.grant()">Consent to Push Notification Privacy Policy</a>
To revoke push notification consent run the following command:
median.onesignal.userPrivacyConsent.revoke()
<a onclick="median.onesignal.userPrivacyConsent.revoke()">Revoke Push Notification Privacy Consent</a>
Revoking Privacy Consent
Revoking OneSignal privacy consent stops your app from sending data to OneSignal, but does not prevent receiving push notifications.
To control which users receive which notifications consider using Tags within OneSignal
Updated 9 months ago