googleads / googleads-consent-sdk-android

Consent SDK
https://developers.google.com/admob/android/eu-consent
Apache License 2.0
100 stars 82 forks source link

Setting .DEBUG_GEOGRAPHY_EEA causes requestConsentInfoUpdate to fail #101

Open Muted55 opened 4 years ago

Muted55 commented 4 years ago

Hello,

Can someone please assist me with an issue I am having when using the .DEBUG_GEOGRAPHY_EEA

When I set the DebugGeography.DEBUG_GEOGRAPHY_NOT_EEA the requestConsentInfoUpdate returns successfully however if I then set it to .DEBUG_GEOGRAPHY_EEA the ConsentInfoUpdate fails.

This occurs on the real device below and on a simulated device. Using Android Studio : compileSdkVersion 29 implementation 'com.google.android.ads.consent:consent-library:1.0.6' Device : Samsung Galaxy J4 (android version 8.0.0) The DEVICE_ID and pub-MY-ID would be replaced when running the app. The code I am using is below:

ConsentInformation.getInstance(this).addTestDevice("DEVICE-ID");

    // Geography appears as in EEA for test devices.
    ConsentInformation.getInstance(this).setDebugGeography(DebugGeography.DEBUG_GEOGRAPHY_EEA);

    // Geography appears as not in EEA for debug devices.
    //ConsentInformation.getInstance(this).setDebugGeography(DebugGeography.DEBUG_GEOGRAPHY_NOT_EEA);

    ConsentInformation consentInformation = ConsentInformation.getInstance(this);
    String[] publisherIds = {"pub-MY-ID"};

    consentInformation.requestConsentInfoUpdate(publisherIds, new ConsentInfoUpdateListener() {
        @Override
        public void onConsentInfoUpdated(ConsentStatus consentStatus) {
            Log.d("consent"," User's consent status successfully updated. ");

        }

        @Override
        public void onFailedToUpdateConsentInfo(String errorDescription) {
            // User's consent status failed to update.
            Log.d("consent"," User's consent status failed to update. ");
        }
    });
rareserban commented 4 years ago

Setting test device as well might help.