trackingconsent

package
v0.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package trackingconsent asks before the app tracks them across other apps and websites, as the App Store requires.

nimbus native plugin add tracking-consent

if s, _ := trackingconsent.Request(ctx); s.Allowed() {
	ads.Personalize()
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Status

type Status string

Status is what they've said.

const (
	// NotAsked means Request will show the prompt.
	NotAsked Status = "not-asked"
	Granted  Status = "granted"
	Denied   Status = "denied"
	// Restricted means the phone doesn't let them choose, such as on a
	// child's account. Treat it as Denied.
	Restricted Status = "restricted"
	// NotNeeded means this platform has no such prompt: Android.
	NotNeeded Status = "not-needed"
)

func Current

func Current(ctx context.Context) (Status, error)

Current says what they've said, without asking.

func Request

func Request(ctx context.Context) (Status, error)

Request shows the prompt, once ever: after that it answers with what they said. Call it from a screen that's on show, or iOS skips the prompt.

func (Status) Allowed

func (s Status) Allowed() bool

Allowed reports whether tracking may go ahead.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL