{"id":18331975,"url":"https://github.com/mrousavy/react-native-tracking-transparency","last_synced_at":"2025-04-04T07:05:59.937Z","repository":{"id":38129391,"uuid":"320332872","full_name":"mrousavy/react-native-tracking-transparency","owner":"mrousavy","description":"🕵️ A React Native Library for interacting with the tracking API from iOS 14.","archived":false,"fork":false,"pushed_at":"2023-02-27T14:53:32.000Z","size":948,"stargazers_count":240,"open_issues_count":11,"forks_count":25,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T06:05:28.375Z","etag":null,"topics":["ios","ios14","library","native","native-module","react","react-native","tracking"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrousavy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-12-10T16:46:54.000Z","updated_at":"2025-02-19T17:52:29.000Z","dependencies_parsed_at":"2024-01-17T01:52:18.846Z","dependency_job_id":null,"html_url":"https://github.com/mrousavy/react-native-tracking-transparency","commit_stats":{"total_commits":21,"total_committers":6,"mean_commits":3.5,"dds":"0.33333333333333337","last_synced_commit":"8026a7d2c43f336d65d985831317c93ad28521db"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrousavy%2Freact-native-tracking-transparency","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrousavy%2Freact-native-tracking-transparency/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrousavy%2Freact-native-tracking-transparency/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrousavy%2Freact-native-tracking-transparency/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrousavy","download_url":"https://codeload.github.com/mrousavy/react-native-tracking-transparency/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247135143,"owners_count":20889420,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ios","ios14","library","native","native-module","react","react-native","tracking"],"created_at":"2024-11-05T19:36:38.638Z","updated_at":"2025-04-04T07:05:59.915Z","avatar_url":"https://github.com/mrousavy.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-tracking-transparency\n\n🕵️ A React Native Library for interacting with the tracking API from iOS 14.\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./img/example-1.png\" width=\"30%\"\u003e\n  \u003cimg src=\"./img/example-2.png\" width=\"30%\"\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n## Installation\n\n1. Install package\n    ```sh\n    npm install react-native-tracking-transparency\n    cd ios\n    pod install\n    ```\n\n2. Add `NSUserTrackingUsageDescription` to your `Info.plist`\n\n## Usage\n\nSee the [example](example/) app for a full code example.\n\n### getTrackingStatus\n\nGets 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.\n\n\u003e Requires iOS 14. On Android and iOS versions below 14, this will always return `'unavailable'`.\n\n```js\nimport { getTrackingStatus } from 'react-native-tracking-transparency';\n\nconst trackingStatus = await getTrackingStatus();\nif (trackingStatus === 'authorized' || trackingStatus === 'unavailable') {\n  // enable tracking features\n}\n```\n\nThe tracking status can return one of the following values:\n\n* `'unavailable'`: The tracking API is not available on the current device. That's the case on Android devices and iPhones below iOS 14.\n* `'denied'`: The user has explicitly denied permission to track. You'd want to respect that and disable any tracking features in your app.\n* `'authorized'`: The user has granted permission to track. You can now enable tracking features in your app.\n* `'restricted'`: The tracking permission alert cannot be shown, because the device is restricted. See [`ATTrackingManager.AuthorizationStatus.restricted`](https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/authorizationstatus/restricted) for more information.\n* `'not-determined'`: The user has not been asked to grant tracking permissions yet. Call `requestTrackingPermission()`.\n\n### requestTrackingPermission\n\nRequests permission to track the user. Requires an [`NSUserTrackingUsageDescription`](https://developer.apple.com/documentation/bundleresources/information_property_list/nsusertrackingusagedescription) key in your `Info.plist`. (See [iOS 14 Tracking API](https://developer.apple.com/documentation/apptrackingtransparency))\n\n\u003e Requires iOS 14. On Android and iOS versions below 14, this will always return `'unavailable'`.\n\n```js\nimport { requestTrackingPermission } from 'react-native-tracking-transparency';\n\nconst trackingStatus = await requestTrackingPermission();\nif (trackingStatus === 'authorized' || trackingStatus === 'unavailable') {\n  // enable tracking features\n}\n```\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrousavy%2Freact-native-tracking-transparency","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrousavy%2Freact-native-tracking-transparency","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrousavy%2Freact-native-tracking-transparency/lists"}