Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you get the "User Consent" in a WebView?

I refer to https://developer.android.com/reference/android/webkit/WebView.html

there is a paragraph stating that

Metrics

WebView may upload anonymous diagnostic data to Google when the user has consented. This data helps Google improve WebView. Data is collected on a per-app basis for each app which has instantiated a WebView. An individual app can opt out of this feature by putting the following tag in its manifest:

  <meta-data android:name="android.webkit.WebView.MetricsOptOut"
             android:value="true" />   

Data will only be uploaded for a given app if the user has consented AND the app has not opted out.

The page does not have any further information about how to get user consent.

So the question now is, what is the code to activate this "User consent" in WebView? is this a settings on WebView like android's "permission" dialog box?

like image 301
Angel Koh Avatar asked Dec 05 '25 20:12

Angel Koh


1 Answers

I believe this is talking about the global consent in the 'Collect App Usage Data' setting on the Apps & Games tab in the settings.

It doesn't pop up an extra box to get a special extra consent just for webviews.

like image 191
Andy Krouwel Avatar answered Dec 11 '25 18:12

Andy Krouwel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!