Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Error: consent form can be used with custom provider selection only. #7

Closed
hacknicity opened this issue May 22, 2018 · 10 comments
Closed
Assignees

Comments

@hacknicity
Copy link

When I try and present the PACConsentForm I get called back with an error:

Error: consent form can be used with custom provider selection only.

This seems to be coming from this code in consentform.html:

    function validateRawResponse(rawResponse) {
      var adNetworks = rawResponse['ad_network_ids'] || [];
      if (!adNetworks) {
        throw Error('Error: invalid ad networks.');
      }

      // All ad networks must have publisher_consent_type `2`.
      for (var i = 0; i < adNetworks.length; i++) {
        var adNetwork = adNetworks[i];
        var publisherConsentType = adNetwork['publisher_consent_type'] || 0;
        if (publisherConsentType != 2) {
          throw Error('Error: consent form can be used with custom provider selection only.');
        }
      }
    }

Debugging a little I tracked down code in PACView.m which is calling the Javascript in the web view:

- (void)updateWebViewInformation {
  dispatch_async(dispatch_get_main_queue(), ^{
    NSMutableDictionary<PACFormKey, id> *mutableFormInformation =
        [self->_formInformation mutableCopy];
    mutableFormInformation[PACFormKeyAppName] = PACShortAppName();
    mutableFormInformation[PACFormKeyAppIcon] = PACIconDataURIString();

    NSString *infoString = PACJSONStringForDictionary(mutableFormInformation);
    NSString *command = PACCreateJavaScriptCommandString(@"setUpConsentDialog", @{
      @"info" : infoString
    });
    [self->_webView stringByEvaluatingJavaScriptFromString:command];
  });
}

The mutableFormInformation contains a lot of JSON. Xcode's debugger output isn't quite valid JSON (lots of things are escaped with backslashes), but I was able to see this using an online JSON formatter:

json

The ad_network_ids array has a single element. My AdMob ad_network_id is obscured in this screenshot. The publisher_consent_type is 1, causing the validateRawResponse to throw the error because "All ad networks must have publisher_consent_type 2"

@dmytro-me
Copy link

I had the same behavior when I used a "commonly used set of ad-tech providers" in Admob -> Blocking Controls -> EU Consent.

You need to select "Custom set of ad technology providers" and choose less than 12 ad providers to use Google's consent SDK. Note that it takes some time to apply this setting.

@hacknicity
Copy link
Author

hacknicity commented May 23, 2018

Thanks Dymtro. I see a list of over 600 ad technology providers to choose from. The "commonly used providers" has 200. I've no idea which 12 to choose!

@alrocha
Copy link

alrocha commented May 28, 2018

I am facing a weird issue, using the SDK for the EU consent, I have chosen 12 ads with the custom configuration
screen shot 2018-05-28 at 15 23 15
When I request the form, I receive this error.

Error: consent form can be used with custom provider selection only.
I tried to put more than 12 and less than 12, still facing the same issue, I have tried the ADMOB id of a friend (who has already apps in production, I don't ) and it works... so I have no idea why is this happening with my admob account...

Sorry if this is not the right thread to came up with this already opened a google issue in a group and in stackoverflow but no answer :( thanks!

@dmytro-me
Copy link

@alrocha have you tried just to wait a few hours after making a change?

@alrocha
Copy link

alrocha commented May 28, 2018

@dmytro-me yes, doesn't work since last Friday, when I added the SDK 😢

@hacknicity
Copy link
Author

hacknicity commented May 28, 2018

Thanks @dmytro-me and @alrocha for more comments. I've given up! I have a few indie apps that show AdMob ads but make very little money. They're basically hobby projects. Ad revenue has been even worse the last few months.

It would be pretty tricky for me to get consent before showing ads and handle the UX around the different choices. I really can't justify the time and effort for the small amount of ad revenue they make. So I just decided to remove ads completely! Some of the apps that had an in-app purchase to remove ads now have an in-app purchase to unlock some features (and people who bought the old iAP get the extra features too). Took me a few days, but I still think it's the better choice for me and my apps.

Good luck everyone. Hopefully they'll be some nice Medium article or Ray Wenderlich tutorial on how to use the consent API soon ;-)

@alrocha
Copy link

alrocha commented May 28, 2018

Yeah is becoming a bit messy lately, tbh I am not adding ads to earn money, is more integrate the SDK and play around, but yeah... makes much more sense add features to the apps and earn money with that.

Cheers and thanks u2!

@alrocha
Copy link

alrocha commented May 28, 2018

LOL after a big headache, I just got an email that my account is verified (from Friday, the day that I created it) so took 4 days to verify it...

@rampara
Copy link
Contributor

rampara commented Jun 25, 2018

Closing issue as it is expected behavior that the Google-rendered consent form is compatible with at most 12 ad technology providers.

@rampara rampara self-assigned this Jun 25, 2018
@rampara rampara closed this as completed Jun 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants