Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consentInfo().listen() gets first info, only #7

Open
xErik opened this issue Jun 27, 2022 · 4 comments
Open

consentInfo().listen() gets first info, only #7

xErik opened this issue Jun 27, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@xErik
Copy link

xErik commented Jun 27, 2022

Quick question, consentInfo().listen() seems not to work correctly in my case.

It gets the first consent-info, but when the user adjusts the consent-settings, it gets nothing.

IabtcfConsentInfo.instance.consentInfo().listen((info) {
  print(info);
 });

Adjusting the consent-settings on my mobile, these get actually written as can be seen in my debug logs, but the listener is not updated with these new settings:

D/UserMessagingPlatform( 5131): Action[write]: {"IABTCF_CmpSdkID":300,"IABTCF_CmpSdkVersion":1,"IABTCF_PolicyVersion":2,"IABTCF_gdprApplies":1, ...

Should consentInfo().listen() actually work or is it due to some discrepancies between UMP evolving over time and this library? Am I doing something wrong?

@blaugold
Copy link
Owner

Thanks for reporting this. listen should work as you expect it to. The plugin listens for changes to the SharedPreferences returned from PreferenceManager.getDefaultSharedPreferences on Android. I'll have to investigate.

@blaugold blaugold added the bug Something isn't working label Jun 29, 2022
@xErik
Copy link
Author

xErik commented Jun 29, 2022

Thank you. Another observation is that the call

await IabtcfConsentInfo.instance.currentConsentInfo()

works the first time. But, after updating the consent using Google UMP SDK in Flutter, each subsequent call does not return the changes values. In this case, a restart of the App helps and the previously changed values are returned.

But as I said, it might be that I am doing something wrong. I am also new to App development.] in general.

@andreacimino
Copy link

andreacimino commented Oct 10, 2023

I have the same issue, i have the suspect that the bug is in this line.

Future<BasicConsentInfo?> currentConsentInfo() => consentInfo().first;

While it should be

Future<BasicConsentInfo?> currentConsentInfo() => consentInfo().last;

since the stream is changed.

Guillergood added a commit to Guillergood/iabtcf_consent_info that referenced this issue Jun 19, 2024
Guillergood added a commit to Guillergood/iabtcf_consent_info that referenced this issue Jun 19, 2024
@Guillergood
Copy link

Hello,
If you need a quick fix, please replace your iabtcf_consent_info value in pubspec.yaml:

iabtcf_consent_info:    
   git:
      branch: getUpdatedContent
      url: https://github.com/Guillergood/iabtcf_consent_info.git
      path: packages/iabtcf_consent_info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants