googleads-consent-sdk-ios icon indicating copy to clipboard operation
googleads-consent-sdk-ios copied to clipboard

Consent SDK Version 1.3 BUG!

Open itzonator opened this issue 5 years ago • 3 comments

Hello, when attempt to show form of this 1.3 version of the Consent SDK, Xcode throws a very strange error:

Consent SDK error

More specifically, this line of code is throwing that error:

** PACConsentStatus *status = PACConsentInformation.sharedInstance.consentStatus;**

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

Now, what's triggering this error and is that a bug with the Consent SDK?

Xcode Version 10.1 (10B61) used!

Please advice!

itzonator avatar Mar 14 '19 08:03 itzonator

got the same issue, for now I just deleted the *

Izzyjm avatar Mar 25 '19 02:03 Izzyjm

got the same issue, for now I just deleted the *

That's nice, but it now says "unused variable status." Therefore I cannot check the user's consent choice.

I might try to store 'status array' in defaults. Once current status is available in array it will not show that Consent form. If not then we will show form and add that status in defaults status array.

Now I cannot check user's consent choice, and the form will load every time on app load.

This would probably solve the problem, but I do not know how to do that in code. Any suggestions?

error

Here's the code:

`

        [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;
                              
                              
                              // store status array in defaults
                              // once current status is available in array we will not show that form
                             // if not then we will show form and add that status in defaults status array
                                  
                                  

                              
                              
                              //Storing publisher managed consent
                              PACConsentInformation.sharedInstance.consentStatus = PACConsentStatusPersonalized;
                              
                              

                          }
                      }];

`

itzonator avatar May 09 '19 13:05 itzonator

it says "unused variable status" because you have not used it, try using it everything works fine for me

Izzyjm avatar May 31 '19 15:05 Izzyjm