Gdpr, Google Consent Sdk And Buildbox

Discussion in 'Technical Discussion' started by itzonator, Mar 14, 2019.

  1. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    595
    Likes Received:
    230
    Does anyone successfully integrated Google Consent SDK into your Buildbox games?

    I have tried to do this, but it looks like the Consent SDK version 1.3 has a bug in it or am I doing something wrong? I also tested with version 1.2, same issue!

    I am using Xcode Version 10.1 (10B61)
    BB3 RC1 version used!

    Here's the error:

    [​IMG]

    ERROR: Cannot initialize a variable of type 'PACConsentStatus *' with an rvalue of type 'PACConsentStatus'

    This line of code is causing it:
    Code:
                                      PACConsentStatus *status = PACConsentInformation.sharedInstance.consentStatus;
    
    Downloaded: Consent SDK (version 1.3)

    Followed Consent SDK Integration Guide for iOS: https://developers.google.com/admob/ios/eu-consent#google_rendered_consent_form

    Added all of this into the GameViewController.mm

    Code:
    - (void)viewDidLoad{
        [super viewDidLoad];
      
        // Google CONSENT SDK - EU CONSENT  -> Update consent status
        [PACConsentInformation.sharedInstance
         requestConsentInfoUpdateForPublisherIdentifiers:@[ @"pub-xxxxxxxxxxxx" ]
         completionHandler:^(NSError *_Nullable error) {
             if (error) {
                 // Consent info update failed.
             } else {
                 // Consent info update succeeded. The shared PACConsentInformation
                 // instance has been updated.
             }
         }];
      
      
        // TODO: Replace with your app's privacy policy url.
        NSURL *privacyURL = [NSURL URLWithString:@"http://yourwebsite/privacy-policy-apps/"];
        PACConsentForm *form = [[PACConsentForm alloc] initWithApplicationPrivacyPolicyURL:privacyURL];
        form.shouldOfferPersonalizedAds = YES;
        form.shouldOfferNonPersonalizedAds = YES;
        form.shouldOfferAdFree = NO;
      
      
        // Load Form
        [form loadWithCompletionHandler:^(NSError *_Nullable error) {
            NSLog(@"Load complete. Error: %@", error);
            if (error) {
                // Handle error.
            } else {
                // Load successful.
              
                // Show Form
                [form presentFromViewController:self
                              dismissCompletion:^(NSError *_Nullable error, BOOL userPrefersAdFree) {
                                  if (error) {
                                      // Handle error.
                                  } else if (userPrefersAdFree) {
                                      // The user prefers to use a paid version of the app.
                                  } else {
                                      // Check the user's consent choice.
                                      PACConsentStatus *status = PACConsentInformation.sharedInstance.consentStatus;
                                  }
                              }];
              
              
            }
        }];
      
      
        // Forward Consent to Google Mobile Ads SDK
        GADRequest *request = [GADRequest request];
        GADExtras *extras = [[GADExtras alloc] init];
        extras.additionalParameters = @{@"npa": @"1"};
        [request registerAdNetworkExtras:extras];
    
      
    // END
    Any ideas?
    @Josh (Tekanology)
    @Astro Games
    @PlayShaft
    @AaroArts
     
  2. George L.

    George L. Boxer

    Joined:
    Feb 23, 2019
    Messages:
    33
    Likes Received:
    3
    Have you manage to make it work ? If so can you please share ? :)
     
  3. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    595
    Likes Received:
    230
    Nope, I haven't. This seems like a bug from Google, I contacted them and they said that they will investigate into the issue, but never got back from them on the status. Probably have to wait for a newer version of Consent SDK.

     
  4. George L.

    George L. Boxer

    Joined:
    Feb 23, 2019
    Messages:
    33
    Likes Received:
    3
    So are you using your app without the consent massage ? :)

    I don't know if I should upload it like this :)
     
  5. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    595
    Likes Received:
    230
    I do have consent message, but that is not the point, Consent SDK stores value based on EU users choose to show more relevant ads if you do not have that probably you will be earning less due to this segmentation of users. There are other ways to store consent based on users choices, but I could not find proper solution. Nik added a Navigation button value for GDPR that is in BB3 and BB2, but couldn’t find a way that is going to replace Google Consent form.
     
  6. George L.

    George L. Boxer

    Joined:
    Feb 23, 2019
    Messages:
    33
    Likes Received:
    3
    So basically the consent message does nothing, just displays a message and that is it , I does not connect with admob or anything like that ? Wont admob ban the account if it does not see consent sdk being used ?
     
  7. George L.

    George L. Boxer

    Joined:
    Feb 23, 2019
    Messages:
    33
    Likes Received:
    3
    BTW, Thanks for your help !
     
  8. George L.

    George L. Boxer

    Joined:
    Feb 23, 2019
    Messages:
    33
    Likes Received:
    3
    Oh and last two question maybe you know this,

    1. Is your message (not consent sdk) displayed every time ? If no how did you do it to show just once in bb2 ?

    2. For android do you have a revoke button in settings ? Basically to give the user access to choose again ? Again if yes how did you do that ?

    Thank you !!!
     
  9. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    595
    Likes Received:
    230
    Well, I just add URL button to privacy policy inside the app and some of my apps have custom code that shows native Ui alert box that is snowing just once on app load, it would be annoying if this message is showing every time.

    I would encourage what top tier publishers are doing to be compliant with GDPR. Download their apps, they leave clue. I do not have any revoke buttons in settings, but that would be good. In Navigation button in Buildbox as part of UI, there is custom option to revoke consent, and custom code has to be added for this to work. Check in some older BB2 releases, in Official Announcements section in this forum where Nik provides more derails, but you will need extra help to prep that extra code by someone if you do not code.
     
  10. George L.

    George L. Boxer

    Joined:
    Feb 23, 2019
    Messages:
    33
    Likes Received:
    3

    Thanks ! I see that Leep's World that has 200M downloads does not have revoke btn either, instead they mention in the policy that if you wish to opt out you need to disable location services and to consult phone manufacturer manual, its funny but it must seems to be ok as they have hundreds of millions downloads :D


    I am very new in programming but can find my way around if I have some examples :D , Would it be possible to share the custom code that shows native Ui alert box that is snowing just once on app load and where you place it (normally without your app details :D just the functionality if possible ? If I am not asking for too much trouble :D

    (I presume for android the code is placed PTPlayer.Java and in IOS in GameViewControler.mm ?)

    Again thanks, If we ever meet I will for sure buy you a beer :)
     
  11. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    595
    Likes Received:
    230
  12. George L.

    George L. Boxer

    Joined:
    Feb 23, 2019
    Messages:
    33
    Likes Received:
    3
    I am getting also

    unknown type name 'GADRequest'
    and unknown type name 'GADExtras'
    in
    GADRequest *request = [GADRequest request];
    GADExtras *extras = [[GADExtras alloc] init];

    And I dont know why, I tried to search but no information ? what did you import in GameViewController.mm besides PersonalizedAdConsent.h ?

    Thanks !
     
  13. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    595
    Likes Received:
    230
    Follow this guide closely: https://developers.google.com/admob/ios/eu-consent#google_rendered_consent_form

    If doing so, you won't have problem with GAD Request. Make sure all frameworks are also imported. But I could not resolve the issue related to the bug in the Consent SDK.



     
  14. George L.

    George L. Boxer

    Joined:
    Feb 23, 2019
    Messages:
    33
    Likes Received:
    3
    Thanks, did everything to the letter and now I am getting linker command failed after i add this part
    // TODO: Replace with your app's privacy policy url.
    NSURL *privacyURL = [NSURL URLWithString:mad:"http://yourwebsite/privacy-policy-apps/"];
    PACConsentForm *form = [[PACConsentForm alloc] initWithApplicationPrivacyPolicyURL:privacyURL];
    form.shouldOfferPersonalizedAds = YES;
    form.shouldOfferNonPersonalizedAds = YES;
    form.shouldOfferAdFree = NO;

    Even without the * for the form
    and try to build the project.

    I hate this :)))

    Anyways thanks for all of your help !

    I think I might try MoPub on IOS although I don't like their platform very much :(
     
    Last edited: May 6, 2019
  15. ArticleBit

    ArticleBit Boxer

    Joined:
    May 3, 2019
    Messages:
    3
    Likes Received:
    1
    Yesterday I found this new monetizing platform called GlobalHop SDK, registered a new account using this coupon (https://dashboard.globalhop.net/register?coupon=GlobalHopSDK) and integrated into my game. They claim they will give 50$ bonus after reaching 150$. Hope this is true and I will make additional money.
     
  16. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    595
    Likes Received:
    230
    Sad, anyone can help this guy? Does anyone have a consent to collect or revoke in their games? It would be nice if you share how you comply with GDPR.
     
  17. George L.

    George L. Boxer

    Joined:
    Feb 23, 2019
    Messages:
    33
    Likes Received:
    3
    So I think I came up with a good solution that I am going to use for this.

    Looking at top tier apps seems that most just have I agree message and link to privacy policy:

    An example is this:

    in Leep's World you are greed with a message saying something along the lines:

    I hereby consent that my Device ID is used for targeted advertising etc etc and i understand that I have the option to opt out as described in the privacy policy and terms of use (links to the policy and terms)

    - In their privacy policy it says that you can opt out by disabling location services

    - They don't have a revoke button (seems that most of the top games don't have a revoke button)

    I have checked other games and they employ similar approaches.

    Given the above I am thinking to do this for IOS

    Code:
    - (void)viewDidLoad{
        [super viewDidLoad];
       
       
        // I will add here a an alert box that shows just once with the text of user agreement and link to policy and on button that just dismisses the alert
        // I still need to understand how to show this message once, i  will try to see if i can find a way to sore a value and check that value
     
        // Google CONSENT SDK - EU CONSENT  -> Update consent status
        [PACConsentInformation.sharedInstance
         requestConsentInfoUpdateForPublisherIdentifiers:@[ @"pub-xxxxxxxxxxxx" ]
         completionHandler:^(NSError *_Nullable error) {
             if (error) {
                 // Consent info update failed.
             } else {
                 // Consent info update succeeded. The shared PACConsentInformation
                 // instance has been updated.
             }
         }];
     
     
    // collect providers
      NSArray *adProviders = PACConsentInformation.sharedInstance.adProviders;
     
    // set cosnent status
      PACConsentInformation.sharedInstance.consentStatus = PACConsentStatusPersonalized;
      
     
     
        // Forward Consent to Google Mobile Ads SDK
        GADRequest *request = [GADRequest request];
        GADExtras *extras = [[GADExtras alloc] init];
        extras.additionalParameters = @{@"npa": @"1"};
        [request registerAdNetworkExtras:extras];
    
     
    // END
     
  18. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    595
    Likes Received:
    230
    Yeeeeah!!! Managed to do it. Just use my code on the first post of this thread, @George L.

    This line was causing this:
    PACConsentStatus *status = PACConsentInformation.sharedInstance.consentStatus;

    Instead, use this:
    PACConsentStatus status = PACConsentInformation.sharedInstance.consentStatus;

    Remove the * thing before status, Google has updated it on their website, since I reported it. Now it works, before it was throwing weird errors. However, if you do this, the chances are you'll get this error: https://stackoverflow.com/questions/50698525/google-consent-sdk-linker-error

    To resolve this, Go to Build Phase -> Link Binary With Libraries then add PersonalizedAdConsent framework

    From Google Fixed it!

    Here's how it should look like in your game: see attachment to this post ;-)
     

    Attached Files:

  19. George L.

    George L. Boxer

    Joined:
    Feb 23, 2019
    Messages:
    33
    Likes Received:
    3
    Awesome ! Quick question how did you import the consent sdk ? Pods or manual ? And did you have to import admob sdk as well to solve the gad part ?
     
  20. George L.

    George L. Boxer

    Joined:
    Feb 23, 2019
    Messages:
    33
    Likes Received:
    3

    I managed to make the build work I don't know why but the form does not show, also after removing the * I get a warning saying that Unused variable 'status'
     

Share This Page