Giter VIP home page Giter VIP logo

react-native-ad-consent's People

Contributors

ashankz avatar birgernass avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

react-native-ad-consent's Issues

Unable to update publisher identifier info

requestConsentInfoUpdate throws this error.

try {
      const {
        consentStatus,
        isConsentFormAvailable,
        isRequestLocationInEeaOrUnknown,
      } = await UMP.requestConsentInfoUpdate();
      console.log('consentStatus', consentStatus);
      if (
        isRequestLocationInEeaOrUnknown &&
        isConsentFormAvailable &&
        consentStatus === UMP.CONSENT_STATUS.REQUIRED
      ) {
        const {consentStatus} = await UMP.showConsentForm();
        console.log('consentStatus', consentStatus);
      }
    } catch (e) {
      console.log('e', e);
    }
e Error: Unable to update publisher identifier info.
    at promiseMethodWrapper (NativeModules.js:104)
    at Object.requestConsentInfoUpdate (index.js:15)
    at requestConsent$ (AdSetup.js:75)
    at tryCatch (runtime.js:63)
    at Generator.invoke [as _invoke] (runtime.js:293)
    at Generator.next (runtime.js:118)
    at tryCatch (runtime.js:63)
    at invoke (runtime.js:154)
    at runtime.js:164
    at tryCallOne (core.js:37)

No available form can be built

I already have (Settings > Google > Ads > Opt out of Ads Personalisation) turned off but still getting "No available form can be built " issue on android

How to know if user selected "Do not consent"?

Currently, after UMP.showConsentForm(), no matter the user selected "Consent" or "Do not consent", the returned result is CONSENT_STATUS.OBTAINED.

So when requesting Ads from Admob, how do I know if I should pass requestNonPersonalizedAdsOnly?
Or I don't have to coz' Google already stored the user's preference?

Thank you!

Xcode compilation error: /ios/Pods/boost-for-react-native/boost/compatibility/cpp_c_headers/cstdarg:10:1: Unknown type name 'namespace'

Getting a bunch of compilation errors on a new react-native project. All seem to be coming from compilation errors on "boost-for-react-native" project.

Steps to repro:-

  1. Create a new React-native project

react-native init AdmobConsentTest

  1. Install react-native-ad-consent package

npm install react-native-ad-consent --save

  1. Link the package

react-native link react-native-ad-consent

  1. Follow the rest of Additional steps:-
    4.a. Add the lines to pod file

pod 'PersonalizedAdConsent'
pod 'Google-Mobile-Ads-SDK'

4.b. Add the following key to your project's Info.plist

GADIsAdManagerApp

4.c. Add the following initalization code to your project's AppDelegate.h:

#import <GoogleMobileAds/GoogleMobileAds.h>

4.d. Add the following initalization code to your project's AppDelegate.m

[GADMobileAds configureWithApplicationID:@"ca-app-pub-xxxxxx~xxxxx"];

Showing Tracking permission after user rejected GDPR prompt

This package is working really well
But today I got this rejection from the App store review.

The message:
We noticed your app includes a GDPR prompt and an App Tracking Transparency permission request, but they are implemented in a way that might confuse the user.
Specifically, your app shows the App Tracking Transparency permission request after the user has already requested you not to track on the GDPR prompt.
In addition to App Tracking Transparency, it is important to include all disclosures required by local laws and regulations wherever your app is distributed. These disclosures should be implemented in a way that is clear and respects the user's choices, regardless of the order in which they are presented to the user.

Next Steps:
If the user denies permission to track once, do not ask them to allow tracking again within the same permission request flow. There should be no tracking activity until the user grants permission to track.
If your app shows the GDPR prompt before showing the App Tracking Transparency permission request, there is no need to modify the wording of the GDPR prompt.

Any idea if this is related to the package and how to fix it?
This is my code:

async function AdsConsentRequest() {
    try {
        const { consentStatus, isConsentFormAvailable, isRequestLocationInEeaOrUnknown } = await UMP.requestConsentInfoUpdate();
        //Request form:
        if(isRequestLocationInEeaOrUnknown && isConsentFormAvailable && consentStatus === UMP.CONSENT_STATUS.REQUIRED) {
            await UMP.showConsentForm();
        }
    } catch(e) {
        // console.log(e);
    }
}

UMP and requestNonPersonalizedAdsOnly

So, as far as I gathered, if we use the UMP from google and we request consent using their Form, we no longer need to use this boolean "requestNonPersonalizedAdsOnly" with Admob libraries, because anything is managed directly from Google system.
Can someone confirm this?

open privacy url in-app

Hi,
First of all, thanks for open-sourcing this package :) very handy!
Is there, by any chance, a possibility to open the privacy url with for example react-native-inappbrowser?
Otherwise, I think that App Store review will complain.

IOS 14 build issues versions after update from v2 to v3 or v4

Google-Mobile-Ads-SDK (8.4.0):

Use of undeclared identifier 'UMPConsentTypeNonPersonalized'
Use of undeclared identifier 'UMPConsentTypeUnknown'; did you mean 'UMPConsentStatusUnknown'?
Use of undeclared identifier 'UMPConsentTypePersonalized'

v3-rn-ad-consent

I have use_frameworks in Podfile.

Should I try to downgrade Google-Mobile-Ads-SDK?

I've added also AppTransparency framework.

Screenshot 2021-04-22 at 13 59 51

Is there any additional step that I am missing?

Any response that could help establishing the cause of this issue will be greatly appreciated.

Note: v2 works fine. I am getting these errors after the update.

RN 0.60+ support?

Execution failed for task ':react-native-ad-consent:mergeDebugShaders'.
> Failed to create directory '\node_modules\react-native-ad-consent\android\build\intermediates\incremental\mergeDebugShaders'

TypeError: null is not an object

I've followed the installation steps for iOS, and running my app on the iOS simulator, I get the following upon start:

TypeError: null is not an object (evaluating '_reactNativeAdConsent.default.requestConsenfInfoUpdate')

I have copied & pasted the example code for asking for consent into my App.js like this:

import RNAdConsent from 'react-native-ad-consent';

[...]
            const consentStatus = await RNAdConsent.requestConsentInfoUpdate({ publisherId: "myID" });

            if (consentStatus === RNAdConsent.UNKNOWN) {
               const formResponse = await RNAdConsent.showGoogleConsentForm({
                  privacyPolicyUrl: "https://your-privacy-link.com",
                  shouldOfferAdFree: false
               });

               if (formResponse === RNAdConsent.PREFERS_AD_FREE) {
                  // do stuff
               } else {
                  await RNAdConsent.setConsentStatus(formResponse)
               }
            }

I have edited AppDelegate.h/.m as advised, and also edited the Info.plist.

I also tried pod install in ios folder, althought not given by the instruction, which tells me:

skipped the react-native dependency 'react-native-ad-consent'. No podspec file was found.

In addition I have added PersonalizedAdConsent via pod but it did not help.

So in fact

import RNAdConsent from 'react-native-ad-consent';

returns null.

What do I have to do?

The example uses privacyUrl but it should uses privacyPolicyUrl

Hello,

The example is using privacyUrl but it should be privacyPolicyUrl. This error does not crash the app but the consent form will not show up.

// Incorrect:
const formResponse = await RNAdConsent.showGoogleConsentForm({
    privacyUrl: "https://your-privacy-link.com",
    shouldOfferAdFree: true,
})
// Correct:
const formResponse = await RNAdConsent.showGoogleConsentForm({
    privacyPolicyUrl: "https://your-privacy-link.com",
    shouldOfferAdFree: true,
})

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.