Consent
This page connects your consent flow to Grona. The SDK starts in UNKNOWN, where it sends no events. You pass the shopper’s answer with Grona.setConsent at launch and whenever it changes. Campaigns render in every state: consent controls what the SDK stores and sends, not what the shopper sees.
Set consent
Section titled “Set consent”-
At launch, right after
Grona.init, pass the answer your app stored:import ai.grona.sdk.Gronaimport ai.grona.sdk.GronaConsentGrona.setConsent(when (consentStore.answer) {AcmeConsent.ACCEPTED -> GronaConsent.GRANTEDAcmeConsent.DECLINED -> GronaConsent.DENIEDAcmeConsent.NOT_ASKED -> GronaConsent.UNKNOWN},) -
Call
setConsentagain whenever the shopper changes their answer, for example from your privacy settings screen.
setConsent is safe from any thread. Which purpose in your consent text covers Grona is your decision and your counsel’s.
What each state does
Section titled “What each state does”GronaConsent |
Events | Stored on the device |
|---|---|---|
UNKNOWN (default) |
Kept in memory only, at most 500, oldest dropped. Nothing is sent. | No events. |
GRANTED |
Stored and sent. Events buffered before consent are dropped, unless sendPreConsentEvents is on. |
The event queue, at most 1,000 events or 7 days. |
DENIED |
Buffer dropped, nothing collected. | The event queue and preview pins are deleted. |
Under every state:
- Campaigns still render. Evaluation happens on the device.
- The configuration fetch carries no identifiers.
- The install id and the configuration state stay on the device. Under
DENIEDnothing sends them. Deleting them would move shoppers between arms and weaken the configuration’s rollback protection.
Under DENIED the SDK also refuses preview pairing, because the pairing request carries the install id.
Pre-consent events
Section titled “Pre-consent events”Events from before the shopper answered are kept in memory. By default they are dropped when consent is granted, so only events after the answer are sent.
GronaOptions.Builder("acme-market") .sendPreConsentEvents(true) // ... .build()With sendPreConsentEvents(true), the SDK sends the buffered events once consent is granted. The option is off by default.
Erasure
Section titled “Erasure”Grona.reset() clears the event queue, the customer id, the profile, grants, the basket snapshot, preview pins and the session, and issues a new install id. Call it for an erasure request on the device. For data already sent, see Google Play Data safety.