React Native Tracking Transparency
π΅οΈ A React Native Library for interacting with the tracking API from iOS 14.
Install / Use
npx skills add mrousavy/react-native-tracking-transparencyInstalls into whichever agent you are using.
README
react-native-tracking-transparency
π΅οΈ A React Native Library for interacting with the tracking API from iOS 14.
<br /> <br /> <p align="center"> <img src="./img/example-1.png" width="30%"> <img src="./img/example-2.png" width="30%"> </p> <br /> <br />Installation
-
Install package
npm install react-native-tracking-transparency cd ios pod install -
Add
NSUserTrackingUsageDescriptionto yourInfo.plist
Usage
See the example app for a full code example.
getTrackingStatus
Gets the current Tracking API status. As of iOS 14, Apple requires apps to only enable tracking (e.g.: advertiser ID collection) when the user has granted tracking permissions.
Requires iOS 14. On Android and iOS versions below 14, this will always return
'unavailable'.
import { getTrackingStatus } from 'react-native-tracking-transparency';
const trackingStatus = await getTrackingStatus();
if (trackingStatus === 'authorized' || trackingStatus === 'unavailable') {
// enable tracking features
}
The tracking status can return one of the following values:
'unavailable': The tracking API is not available on the current device. That's the case on Android devices and iPhones below iOS 14.'denied': The user has explicitly denied permission to track. You'd want to respect that and disable any tracking features in your app.'authorized': The user has granted permission to track. You can now enable tracking features in your app.'restricted': The tracking permission alert cannot be shown, because the device is restricted. SeeATTrackingManager.AuthorizationStatus.restrictedfor more information.'not-determined': The user has not been asked to grant tracking permissions yet. CallrequestTrackingPermission().
requestTrackingPermission
Requests permission to track the user. Requires an NSUserTrackingUsageDescription key in your Info.plist. (See iOS 14 Tracking API)
Requires iOS 14. On Android and iOS versions below 14, this will always return
'unavailable'.
import { requestTrackingPermission } from 'react-native-tracking-transparency';
const trackingStatus = await requestTrackingPermission();
if (trackingStatus === 'authorized' || trackingStatus === 'unavailable') {
// enable tracking features
}
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Related Skills
node-connect
385.6kDiagnose OpenClaw Android, iOS, or macOS node pairing, QR/setup code, route, auth, and connection failures.
imsg
385.6kUse the imsg CLI from OpenClaw agents for iMessage/SMS DMs, groups, replies, reactions, polls, watching, and private-API actions.
Agent Development
140.7kThis skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, orβ¦
review-duplication
106.4kUse this skill during code reviews to proactively investigate the codebase for duplicated functionality, reinvented wheels, or failure to reuse existing project best practices and shared utilities.
