One Logo Pool Ball
wwwwwwwwwwwwwwwwwww

App Tracking Permission

Request and inspect iOS App Tracking Transparency permission

One.AppTracking exposes the system’s App Tracking Transparency status and one-time permission request. Use it when your app needs permission for tracking across other companies’ apps or websites.

import { One } from 'one'
const before = One.AppTracking.getPermissionStatus()
if (before === 'notDetermined') {
const after = await One.AppTracking.requestPermission()
if (after === 'authorized') {
// start the tracking-dependent feature
}
}

The status is notDetermined, restricted, denied, or authorized. requestPermission() returns the current status when the system has already decided. Concurrent calls share the same request. The system prompts only while the app is active and no other permission prompt is pending. If the app is inactive before a new request, the call rejects with E_APP_TRACKING_INACTIVE. If iOS dismisses the prompt without a choice, the request returns notDetermined; request again after the app becomes active and other permission prompts close.

Add a non-empty NSUserTrackingUsageDescription to the iOS Info.plist before building. With One prebuild, set native.app.ios.infoPlist.NSUserTrackingUsageDescription. With Expo prebuild, set expo.ios.infoPlist.NSUserTrackingUsageDescription. Without it, requestPermission() rejects with E_APP_TRACKING_MANIFEST.

App Tracking Transparency is implemented on iOS. Android and web return denied from both permission methods. See Apple’s App Tracking Transparency guide.

Edit this page on GitHub.