Require User Privacy Consent


By default your app will automatically send device data to OneSignal to initialize. This includes obtaining a oneSignalUserId which can be used to associate the device and user. To facilitate GDPR compliance you may optionally defer sending data until consent is received from the user and trigger manually via JavaScript.

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 GoNative 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.

↔️GoNative 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.

<a onclick="gonative.onesignal.userPrivacyConsent.grant()">Consent to Push Notification Privacy Policy</a>

To revoke push notification consent run the following command:

<a onclick="gonative.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