Skip to content
The mobile SDKs are available on request. Email support@grona.ai to get access.

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.

  1. At launch, right after Grona.init, pass the answer your app stored:

    import ai.grona.sdk.Grona
    import ai.grona.sdk.GronaConsent
    Grona.setConsent(
    when (consentStore.answer) {
    AcmeConsent.ACCEPTED -> GronaConsent.GRANTED
    AcmeConsent.DECLINED -> GronaConsent.DENIED
    AcmeConsent.NOT_ASKED -> GronaConsent.UNKNOWN
    },
    )
  2. Call setConsent again 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.

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 DENIED nothing 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.

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.

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.