1. Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

Android Google Consent SDK - works 1st time only on device

Discussion in 'GameMaker Studio 2 Community Tech Support' started by degziebob, May 31, 2019.

  1. degziebob

    degziebob Member

    Joined:
    Sep 28, 2016
    Posts:
    10
    Hi,

    As part of GPDR I'm using the GooglePlayServicesExtension (3.1.1) to showthe consent form , latest GMS2, Android Build: 28.03, Support lib: 28.0.0, target SDK: 28, Minimum SDK: 19, Compile SDK: 28

    If I use a virtual android device for testing (Android studio) the following will run and normally (say 80% of the time) run the GPDR popup.

    global.ads_consent_id="<MYID>"
    GoogleMobileAds_Init("", global.ads_app_id);
    GoogleMobileAds_ConsentDebugAddDevice("<removed>");
    GoogleMobileAds_ConsentDebugSetDeviceInEEA(true);
    global.ads_consent_id = "pub-1XXXXXXXXX"
    global.ads_privacy_url = "https://www.myurl.com";
    GoogleMobileAds_ConsentUpdate(global.ads_consent_id, global.ads_privacy_url, true, true, true);

    The above works, and via an Async event I get the value and set it - and that's all good but I'm trying to rerun that popup as you have to give the person the option to change it. I can't get it to show a second time.

    I ran the above on my Android phone and the very first time it ran I got the popup and set it to Personalised ads - that works - but it will not show again. I must be doing something really daft, any ideas?

    2) There is a function the SDK called GoogleMobileAds_ConsentIsUserInEEA() which I was hoping to call and then return the EEA value - but it never runs and no value is set, no Async value returns... From the Android forums (not GMS) that looks to be possible, but can't get it to return anything.


    I followed this article: https://help.yoyogames.com/hc/en-us/articles/360019956652-iOS-and-Android-Google-Consent-SDK

    If anyone has a demo to a working GMS sdk popup that would be awesome.

    Thanks.
     
  2. degziebob

    degziebob Member

    Joined:
    Sep 28, 2016
    Posts:
    10
    I found this last night GoogleMobileAds_ConsentFormShow() but it just errored, now I have read the error properly when I call it using:

    GoogleMobileAds_ConsentFormShow(global.ads_privacy_url,true,true,true)

    I get:
    05-31 11:36:43.702 14323 14350 I yoyo : Attempting to show consent form.
    05-31 11:36:43.702 14323 14350 I yoyo : InvocationTargetException thrown trying to call method GoogleMobileAds_ConsentFormShow on GooglePlayServicesExtension
    05-31 11:36:43.702 14323 14350 I yoyo : Target exception: Can't create handler inside thread Thread[GLThread 439,5,main] that has not called Looper.prepare(). Cause: null. Stack trace:
    05-31 11:36:43.702 14323 14350 I yoyo : java.lang.RuntimeException: Can't create handler inside thread Thread[GLThread 439,5,main] that has not called Looper.prepare()

    Any ideas?
     
  3. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    7,149
    Hi there! Could you please file a bug report? Include a download link to the project if possible, and also a link to this topic. Thanks!
     
  4. degziebob

    degziebob Member

    Joined:
    Sep 28, 2016
    Posts:
    10
    Ticket #158353 logged. Thx
     
    Nocturne likes this.
  5. BobbySonOfRasmus

    BobbySonOfRasmus Member

    Joined:
    Jul 15, 2018
    Posts:
    4
    Was this resolved? I am having a similar issue (for iOS in xcode) where I cannot get the consent form to fire and, based on the error message from the async call back, it is due to the test device not being in the EEA region. I am using this...

    Code:
    GoogleMobileAds_Init("", ads_app_id);
    GoogleMobileAds_ConsentDebugAddDevice(ads_device_id);
    GoogleMobileAds_ConsentDebugSetDeviceInEEA(true);
    ...to add the device to EEA, and unfortunately, still no luck. I even changed my device region to Germany and VPNed through Germany (just to cover all possible bases) and still no luck. I am still receiving the error:

    Code:
    Error: request is not in EEA or unknown.
    It seemed somewhat related to OP's issue, so figured I would bump this thread.
     
  6. degziebob

    degziebob Member

    Joined:
    Sep 28, 2016
    Posts:
    10
    I logged a ticket a month ago, got no response.

    I found a workaround by using this and it works fine for me... I read that within googles code its essentially just connecting to that api (url) and getting the response.


    global.result_post = http_get("https://adservice.google.com/getconfig/pubvendors");

    then in an http Async:

    eea_result=-1 //default so it it doesn't get a value back it assumes we haven't checked -it'll check again on next launch
    var json = async_load[? "result"];
    if string(json) != "" and string(json) != "undefined" {
    var map = json_decode(json)
    if (map=-1) {exit } //error inside this
    if (ds_map_exists(map,"is_request_in_eea_or_unknown")) {
    eea_result=ds_map_find_value(map,"is_request_in_eea_or_unknown")
    } else {
    eea_result=0
    }
    }
     
  7. BobbySonOfRasmus

    BobbySonOfRasmus Member

    Joined:
    Jul 15, 2018
    Posts:
    4
    Okay this makes sense then. It seems the test device setup is not working as expected. I have finally been able to get the Google consent sheet to fire but only after I used a VPN on the device itself. Apparently you are right in that the consent sdk seems to be checking the actual location of the device and not the region it is set in (or even in the app store it is downloaded from).
     
  8. degziebob

    degziebob Member

    Joined:
    Sep 28, 2016
    Posts:
    10
    Hi,

    It looks like this may now be fixed, just got this:

    "Sorry for the long delay in responding. The 3.1.2 version of the Google Play Services extension had some fixes for the consent form, and we have now today released version 3.1.3 of the extension, which fixes a couple more issues and updated the version of the ad library being targeted, so hopefully you'll find that if you update the extension in your project to 3.1.3, then your issue no longer occurs.

    Please note if you haven't already, you will need to update to GMS2 2.2.3 as well before you can use the new Google Play Services extension, otherwise you will get an error when trying to build your project."

    You might want to give that a go and see if it solves your problem too.

    Cheers.
     
  9. cageist

    cageist Member

    Joined:
    Mar 16, 2019
    Posts:
    12
    I'm using the latest stable IDE and runtime (2.2.3) and latest extension (3.1.3) and still getting the same error when trying to call GoogleMobileAds_ConsentFormShow() and GoogleMobileAds_ConsentIsUserInEEA() still doesn't work. (Although it's hard to be sure when there's no help file or manual).
     
    Last edited: Jul 19, 2019
  10. cageist

    cageist Member

    Joined:
    Mar 16, 2019
    Posts:
    12
  11. pipebkOT

    pipebkOT Member

    Joined:
    Dec 13, 2018
    Posts:
    213
  12. cageist

    cageist Member

    Joined:
    Mar 16, 2019
    Posts:
    12
  13. Mert

    Mert Member

    Joined:
    Jul 20, 2016
    Posts:
    441
  14. cageist

    cageist Member

    Joined:
    Mar 16, 2019
    Posts:
    12
  15. Guest

    Guest Guest

    Is there any reason not to just manually get the user's consent, i.e., code a screen with a privacy explanation and "agree" button yourself?

    I was waiting for YYG to fix this, but then I decided I didn't want to (1) wait, (2) rely on them to keep it working, or (3) rely on a third party like Kaguva or Mert to keep it working until they wake up and switch game engines, so I coded a screen myself. Am I missing something?
     
    Andrey likes this.
  16. cageist

    cageist Member

    Joined:
    Mar 16, 2019
    Posts:
    12
    Well you wouldn't want to show the consent if they're outside of the EEA as it's not needed. And if you're using personalized ads, if the user is in the EEA you need to provide a link to the privacy policy for each ad provider (not Google Play, the ad providers like Facebook etc, by default there are hundreds). And you need to give an option to turn off personalized ads and update that with Google so they stop serving the personalized ads and just send anonymous ones. Plus you need a way to retrigger the form if the user changes their mind. Also they need to be over the age of consent for their country (13-16) for EEA as you can't collect data on children for the personalized ads even if they agree. Plus you want to cache the result from the form with Google so it only pops up the first time you run the game, not every single time. Basically it's a huge pain in the ass
     
  17. Andrey

    Andrey Member

    Joined:
    Jun 21, 2016
    Posts:
    286
    In my opinion, independent creation of consent forms and other things is much more reliable. This can be perfectly fit into the design of the game. I'm showing the consent form to the whole world.
     
  18. cageist

    cageist Member

    Joined:
    Mar 16, 2019
    Posts:
    12
    If you're using the Google Consent SDK (not the YoYo version) and making your own extension with it, then I agree. If not, then I doubt your form meets the legal requirements.
     
  19. Andrey

    Andrey Member

    Joined:
    Jun 21, 2016
    Posts:
    286
    You can display any form of consent before the ads initialization. Ask what you want, given the laws. Once obtained the consent, initialize advertising, setting appropriate restrictions on the showing of age, geotargeting.
     
  20. cageist

    cageist Member

    Joined:
    Mar 16, 2019
    Posts:
    12
    That sounds ideal, but maybe a lot of work. Even though I've got the Google form working, I would be interested to see how you have implemented this.
     
  21. Guest

    Guest Guest

    I'll post a screenshot of mine later (on mobile now), but a question for all of you---I know @Mert said in another thread that you have to give the option for non-personalized ads, but I haven't been able to find that as a requirement anywhere... Is there any source for that?

    Right now I have it implicitly require personalized ads or else not use the game.

    Edit: attached the screen, I forgot that mine is a phone game and phones take screenshots.
     

    Attached Files:

    Last edited by a moderator: Jul 20, 2019
    cageist likes this.
  22. Mert

    Mert Member

    Joined:
    Jul 20, 2016
    Posts:
    441
    Whenever you call a ANY ADS, you simple request an ad by configuring an AdRequest object(That is in Java). When building a request, you may add several parameters to it.

    * For example, if you add tagForChildDirectedTreatment(true) to this request, the AD that'll be requested will be suited for children
    * You may add "Android Bundles" to this request, like putBoolean("tag_for_under_age_of_consent", true); to make it compatible with EU Age Consent laws.
    * Or extras.putString("max_ad_content_rating", "MA"); to say "My App is suitable only for mature audiences; includes topics such as alcohol, gambling, sexual content, and weapons.

    The issue is, under GDPR you must keep a clean record of the consent too. Just directing it, is not enough(Unless you have a solid, good working consent collection mechanism). This is why the Consent SDK is created, and there are consent collecting services.

    It's against GDPR yea. You cannot say "Accept this or leave my game" :D

    You know what, I'll create an Admob extension. I needed one for myself anyways.
     
    cageist and Guest like this.
  23. cageist

    cageist Member

    Joined:
    Mar 16, 2019
    Posts:
    12
    If the extension checked the players age I would definitely buy it, that is the most mind boggling to me, because every EU country has different age of consent. And the consent data is stored with Google (I think) but the age data is not. It makes me upset just thinking about it. Lol
     
    Narayan Lewandowski likes this.
  24. DireMind

    DireMind Member

    Joined:
    Aug 31, 2016
    Posts:
    40
    Has the OPs issue been resolved? I have the same issue. I can show the consent form once and then never again. Only a reinstall of the app will allow the consent form to show again.

    I've tried using "GoogleMobileAds_ConsentFormShow(global.ads_privacy_url,true,true,true)" but this doesn't seem to do anything. Anyone have any luck getting the consent form to show more than once? I'd like to offer users the chance to make a change.
     

Share This Page