All Projects → birgernass → react-native-ad-consent

birgernass / react-native-ad-consent

Licence: MIT license
Google's User Messaging Platform (UMP SDK) for React Native.

Programming Languages

java
68154 projects - #9 most used programming language
objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-native-ad-consent

iabtcf-es
Official compliant tool suite for implementing the Transparency and Consent Framework (TCF) v2.0. The essential toolkit for CMPs.
Stars: ✭ 102 (+240%)
Mutual labels:  iab, tcf, gdpr-consent
admob
Admob for React Native with powerful hooks and components
Stars: ✭ 124 (+313.33%)
Mutual labels:  ads, admob
AKGADWrapper
A wrapper for a UIViewController with a GADBannerView at the bottom
Stars: ✭ 55 (+83.33%)
Mutual labels:  ads, admob
Godotads
Godot all in one ads module for Android. (Customizable)
Stars: ✭ 137 (+356.67%)
Mutual labels:  ads, admob
ADEasy
一套全广告平台的快速集成框架。A fast integration framework for a full advertising platform.
Stars: ✭ 79 (+163.33%)
Mutual labels:  ads
Twitch Hls Adblock
Block advertisements that are inserted in Twitch streams directly.
Stars: ✭ 242 (+706.67%)
Mutual labels:  ads
Iosadblocklist
Ultimate Host List for Mobile Adblockers (Focused on iOS)
Stars: ✭ 229 (+663.33%)
Mutual labels:  ads
Admobadapter
It wraps your Adapter to display Admob native ads and banners in a ListView/RecyclerView data set. It based on the Yahoo fetchr project https://github.com/yahoo/fetchr
Stars: ✭ 224 (+646.67%)
Mutual labels:  ads
blocklists
An opinionated collection of blocklists for RethinkDNS.
Stars: ✭ 50 (+66.67%)
Mutual labels:  ads
daily-monetization
Serve ads from different providers
Stars: ✭ 29 (-3.33%)
Mutual labels:  ads
Android-WebView-in-Kotlin
Native Android WebView Example in Kotlin. Website to android app github open source template.
Stars: ✭ 87 (+190%)
Mutual labels:  admob
mifitxiaomipiholelist
MiFit/Xiaomi PiHole Bock List
Stars: ✭ 28 (-6.67%)
Mutual labels:  ads
extensions
Code Generators and Extensions for vanilla-rtb stack
Stars: ✭ 16 (-46.67%)
Mutual labels:  ads
Awesome Ad Free
Curated list of ad-free alternatives to popular services on the web
Stars: ✭ 235 (+683.33%)
Mutual labels:  ads
ti.admob
Use the Google AdMob SDK on iOS and Android with Titanium
Stars: ✭ 51 (+70%)
Mutual labels:  admob
Rvparallaximageview
RvParallaxImageView用在recyclerview的item中,它可以随着recyclerview进行视差效果的移动,进而可以在一个小区域的item中展示一个完整的图片。适用于在recyclerview的item中显示大的广告图。
Stars: ✭ 224 (+646.67%)
Mutual labels:  ads
ionic3-woocommerce
Ionic 3 Woocommerce Template
Stars: ✭ 17 (-43.33%)
Mutual labels:  admob
Adware-ads-network-server
Online Advertising Network Server
Stars: ✭ 44 (+46.67%)
Mutual labels:  ads
Mutify
An android app built with java to mute Spotify ads.
Stars: ✭ 61 (+103.33%)
Mutual labels:  ads
TedAdmobDialog
[Android]BackPress Ad Dialog for Admob
Stars: ✭ 37 (+23.33%)
Mutual labels:  admob

Recommendation: The code of this repository was merged into react-native-google-mobile-ads, a better maintained and more feature-rich library. Consider using it instead of this library.

react-native-ad-consent

Google's User Messaging Platform (UMP SDK) for React Native.

Getting started

$ yarn add react-native-ad-consent

or

$ npm install react-native-ad-consent

Additional Steps (iOS)

Make sure that you have your App ID and the NSUserTrackingUsageDescription in your project's Info.plist as shown here.

+               <key>GADApplicationIdentifier</key>
+               <string>ca-app-pub-3940256099942544~3347511713</string>
+               <key>NSUserTrackingUsageDescription</key>
+               <string>This identifier will be used to deliver personalized ads to you.</string>
              </dict>
            </plist>

Additional Steps (Android)

Make sure you have your App ID in your project's AndroidManifest.xml:

+             <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-3940256099942544~3347511713"/>
            </application>

Usage

import { UMP } from 'react-native-ad-consent'

const {
  consentStatus,
  isConsentFormAvailable,
  isRequestLocationInEeaOrUnknown,
} = await UMP.requestConsentInfoUpdate()

if (
  isRequestLocationInEeaOrUnknown &&
  isConsentFormAvailable &&
  consentStatus === UMP.CONSENT_STATUS.REQUIRED
) {
  const { consentStatus } = await UMP.showConsentForm()
}

Testing

const {
  consentStatus,
  isConsentFormAvailable,
  isRequestLocationInEeaOrUnknown,
} = await UMP.requestConsentInfoUpdate({
   debugGeography: UMP.DEBUG_GEOGRAPHY.EEA,
   testDeviceIds: ['TEST-DEVICE-HASHED-ID'],
})

The 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. You 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. The 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

API

requestConsentInfoUpdate(config?: ConsentInfoConfig): Promise<ConsentInfoUpdate>

type ConsentInfoConfig = {
  debugGeography: number,
  tagForUnderAgeOfConsent: boolean,
  testDeviceIds: string[],
}

type ConsentInfoUpdate = {
  consentStatus: number,
  isConsentFormAvailable: boolean,
  isRequestLocationInEeaOrUnknown: boolean,
}

Returns the consent information.

showConsentForm(): Promise<ConsentFormResponse>

type ConsentFormResponse = {
  consentStatus: number,
}

Shows the consent form and returns the updated consentStatus on close.

reset(): void

Resets the consent state.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].