{"id":21053463,"url":"https://github.com/birgernass/react-native-ad-consent","last_synced_at":"2025-03-15T19:15:24.558Z","repository":{"id":48017833,"uuid":"184303390","full_name":"birgernass/react-native-ad-consent","owner":"birgernass","description":"Google's User Messaging Platform (UMP SDK) for React Native.","archived":false,"fork":false,"pushed_at":"2024-09-02T14:46:48.000Z","size":245,"stargazers_count":36,"open_issues_count":6,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T22:17:28.921Z","etag":null,"topics":["ad-manager","admob","ads","consent","consent-form","consent-library","consent-sdk","eea","gdpr-consent","google","iab","personalized-ads","publisher","react-native","tcf","tcfv2","ump","ump-sdk","user-choice","user-consent"],"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/birgernass.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-30T17:23:03.000Z","updated_at":"2024-11-12T14:08:23.000Z","dependencies_parsed_at":"2025-01-15T11:12:47.576Z","dependency_job_id":"e2d6777f-1f02-4766-80f1-c8a0d0b128ce","html_url":"https://github.com/birgernass/react-native-ad-consent","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/birgernass%2Freact-native-ad-consent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/birgernass%2Freact-native-ad-consent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/birgernass%2Freact-native-ad-consent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/birgernass%2Freact-native-ad-consent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/birgernass","download_url":"https://codeload.github.com/birgernass/react-native-ad-consent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243777305,"owners_count":20346358,"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":["ad-manager","admob","ads","consent","consent-form","consent-library","consent-sdk","eea","gdpr-consent","google","iab","personalized-ads","publisher","react-native","tcf","tcfv2","ump","ump-sdk","user-choice","user-consent"],"created_at":"2024-11-19T16:06:43.995Z","updated_at":"2025-03-15T19:15:24.532Z","avatar_url":"https://github.com/birgernass.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e **Recommendation:** The code of this repository was merged into [react-native-google-mobile-ads](https://github.com/invertase/react-native-google-mobile-ads), a better maintained and more feature-rich library. Consider using it instead of this library.\n\n# react-native-ad-consent\n\nGoogle's User Messaging Platform (UMP SDK) for React Native.\n\n## Getting started\n\n```sh\n$ yarn add react-native-ad-consent\n```\n\nor\n\n```sh\n$ npm install react-native-ad-consent\n```\n\n## Usage\n\n```javascript\nimport { UMP } from 'react-native-ad-consent'\n\nconst {\n  consentStatus,\n  isConsentFormAvailable,\n  isRequestLocationInEeaOrUnknown,\n} = await UMP.requestConsentInfoUpdate()\n\nif (\n  isRequestLocationInEeaOrUnknown \u0026\u0026\n  isConsentFormAvailable \u0026\u0026\n  consentStatus === UMP.CONSENT_STATUS.REQUIRED\n) {\n  const { canRequestAds, consentStatus } = await UMP.showConsentForm()\n}\n```\n\n### Testing\n\n```javascript\nconst {\n  canRequestAds,\n  consentStatus,\n  isConsentFormAvailable,\n  isRequestLocationInEeaOrUnknown,\n  privacyOptionsRequirementStatus,\n} = await UMP.requestConsentInfoUpdate({\n   debugGeography: UMP.DEBUG_GEOGRAPHY.EEA,\n   testDeviceIds: ['TEST-DEVICE-HASHED-ID'],\n})\n```\n\n\u003eThe UMP SDK provides a simple way to test your app's behavior as though the device was located in the EEA or UK using the debugGeography property of type UMPDebugGeography on UMPDebugSettings.\n\u003eYou will need to provide your test device's hashed ID in your app's debug settings to use the debug functionality. If you call requestConsentUpdateWithParameters without setting this value, your app will log the required ID hash when run.\n\u003eThe UMP SDK provides a simple way to test your app's behavior as though the device was located in the EEA or UK using the debugGeography property of type UMPDebugGeography on UMPDebugSettings. _[source](https://developers.google.com/admob/ump/ios/quick-start#testing)_\n\n## API\n\n#### `requestConsentInfoUpdate(config?: ConsentInfoConfig): Promise\u003cConsentInfoUpdate\u003e`\n\n```\ntype ConsentInfoConfig = {\n  debugGeography: number,\n  tagForUnderAgeOfConsent: boolean,\n  testDeviceIds: string[],\n}\n\ntype ConsentInfoUpdate = {\n  consentStatus: number,\n  isConsentFormAvailable: boolean,\n  isRequestLocationInEeaOrUnknown: boolean,\n}\n```\n\nReturns the consent information.\n\n#### `showConsentForm(): Promise\u003cConsentFormResponse\u003e`\n\n```\ntype ConsentFormResponse = {\n  consentStatus: number,\n}\n```\n\nShows the consent form and returns the updated consentStatus on close.\n\n#### `reset(): void`\n\nResets the consent state.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbirgernass%2Freact-native-ad-consent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbirgernass%2Freact-native-ad-consent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbirgernass%2Freact-native-ad-consent/lists"}