Getting Started
Copy a setup prompt with the install steps and the full markdown guide for this plugin.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-app-tracking-transparency`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/app-tracking-transparency/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
Install
Section titled “Install”bun add @capgo/capacitor-app-tracking-transparencybunx cap syncImport
Section titled “Import”import { AppTrackingTransparency } from '@capgo/capacitor-app-tracking-transparency';API Overview
Section titled “API Overview”getStatus
Section titled “getStatus”Gets the current tracking authorization status without prompting the user.
import { AppTrackingTransparency } from '@capgo/capacitor-app-tracking-transparency';
const { status } = await AppTrackingTransparency.getStatus();if (status === 'authorized') { console.log('Tracking is authorized');}requestPermission
Section titled “requestPermission”Requests user authorization to access app-related data for tracking. Displays the native iOS tracking permission dialog.
Note: This method will only show the dialog once. Subsequent calls will return the stored authorization status without showing the dialog.
import { AppTrackingTransparency } from '@capgo/capacitor-app-tracking-transparency';
const { status } = await AppTrackingTransparency.requestPermission();switch (status) { case 'authorized': console.log('User authorized tracking'); break; case 'denied': console.log('User denied tracking'); break; case 'restricted': console.log('Tracking is restricted'); break; case 'notDetermined': console.log('Status not determined'); break;}Type Reference
Section titled “Type Reference”AppTrackingStatusResponse
Section titled “AppTrackingStatusResponse”Response object containing the tracking authorization status.
export interface AppTrackingStatusResponse { /** * The current tracking authorization status. * * @since 1.0.0 */ status: AppTrackingStatus;}AppTrackingStatus
Section titled “AppTrackingStatus”Possible values for the tracking authorization status.
export type AppTrackingStatus = 'authorized' | 'denied' | 'notDetermined' | 'restricted';Source Of Truth
Section titled “Source Of Truth”This page is generated from the plugin’s src/definitions.ts. Re-run the sync when the public API changes upstream.