Hi again, Jack.
This is the sequence that I see:
When button1 is clicked "ConsentPage" is loaded. At the end of the 'B4XPage_Created' event the line
B4X:
B4xConsent.Initialize(Me, Root, Lang, jsonString)
is executed, and the flow goes to the 'Initialize' Sub in 'B4X_Ad_Consent' module. When 'htmlcode' is loaded in WebView1 ...
B4X:
Webview1.LoadHtml(htmlcode)
... the event 'WebView1_PageFinished' is raised. In this Sub we have
B4X:
wve.executeJavascript(Webview1, $"setUpConsentDialog(${SettingsJSON});showAppPrivacyPolicy = dismissConsentModal('show_privacy_policy');"$)
, that produces the 'Webview1_OverrideUrl' event, in which the line
B4X:
ParentModule.Consent_Response(Url)
, leads the flow to the Sub Consent_Response module in 'ConsentPage', with the string 'show_privacy_policy', that makes the Privacy Policy to appear.
Summarizing: when the button is clicked for the first time the app privacy policy page is open, but we only want to show it when the corresponding link is clicked (this works fine). This only happens the first time the button is clicked, and I think it's just a matter of sorting things, or modify the code a bit
Note that the result is the same when clicking the app privacy policy link and the one for showing providers list (the one above the button for personalized ads). The app privacy policy is shown in both cases.
And still we need to load the list of ads providers (when the link works), and create links/buttons to their privacy policies automatically. It would be better, of course, if it is obtained from ConsentManager, but I don't know if coding this is worth it. Can be done as in my example, downloading our own CSV file from AdMob Console and showing the list when the now-not-working link works.
Thank you