Skip to content
This repository has been archived by the owner on Mar 12, 2022. It is now read-only.

Complying with the Precise Location Data Policy

Bruno D'Luka edited this page Jan 18, 2021 · 1 revision

Recent updates to the Google Publisher Policies have introduced new notice and consent requirements for publishers who pass users’ precise location data to Google, for ads-related purposes.

If this policy applies to you, the snippet below shows one way you could inform your users of this data sharing:

void presentConsentOverlay(BuildContext context) {
  showDialog(
    context: context,
    builder: (context) => AlertDialog(
      title: Text('Location data'),
      content: Text(
        'We may use your location and share it with third parties, ' +
        'for the purposes of personalized advertising, analytics and ' +
        'attribution. To learn more, visit our privacy policy at ' +
        'https://myapp.com/privacy.',
      ),
    ),
    actions: [
      FlatButton(
        child: Text('OK'),
        // TODO: Log user consent
        onPressed: () => Navigator.pop(context),
      ),
    ],
  );
}

// To use the above method:
presentConsentOverlay(context);