Política de dados de local exato

Selecione a plataforma: Android iOS Unity Android (legada)

Se você transmitir dados de localização precisos dos seus usuários ao Google, as Políticas do Google para publishers vão fornecer requisitos de consentimento e um aviso.

Se essa política se aplica a você, o exemplo a seguir define o título, a mensagem e o texto do botão para informar os usuários sobre o compartilhamento de dados:

Swift

func presentConsentOverlayFromViewController(_ rootViewController: UIViewController) {
  if (rootViewController == nil) {
    return;
  }

  DispatchQueue.main.async {
    let alert = UIAlertController(title: "TITLE",
        message: "MESSAGE_TEXT",
        preferredStyle: .alert)
    let alertAction = UIAlertAction(title: "BUTTON_TEXT",
        style: .default,
        handler: { _ in
          print("CONSENT_RECEIVED_LOG_MESSAGE")
        }
    )
    alert.addAction(alertAction)
    rootViewController.present(alert, animated: true, completion: nil)
  }
}

// To use the previous function, and if you are in a view controller, call:
presentConsentOverlayFromViewController(self)

Objective-C

- (void)presentConsentOverlayFromViewController:(UIViewController *)rootViewController {
  if (rootViewController == nil) {
    return;
  }

  dispatch_async(dispatch_get_main_queue(), ^{
      UIAlertController *alert = [UIAlertController
          alertControllerWithTitle:@"TITLE"
          message: @"MESSAGE_TEXT"
          preferredStyle:UIAlertControllerStyleAlert];
      UIAlertAction *ok = [UIAlertAction
          actionWithTitle:@"BUTTON_TEXT"
          style:UIAlertActionStyleDefault
          handler:^(UIAlertAction *action) {
            [alert dismissViewControllerAnimated:YES completion:^{
            NSLog(@"CONSENT_RECEIVED_LOG_MESSAGE");
            }];
          }];

      [alert addAction:ok];
      [rootViewController presentViewController:alert animated:YES completion:nil];
  });
}

// To use the previous function, and if you are in a view controller, call:
[self presentConsentOverlayFromViewController:self];

Substitua:

  • TITLE: o título da caixa de diálogo de consentimento, por exemplo, Location data.
  • MESSAGE_TEXT: o texto da caixa de diálogo de consentimento, por exemplo:

    We may use your location and share with third parties for the
    purposes of personalized advertising, analytics, and attributions. To learn
    more, visit our privacy policy at example.com.
    
  • BUTTON_TEXT: o texto do botão da caixa de diálogo de consentimento, por exemplo, OK.

  • CONSENT_RECEIVED_LOG_MESSAGE: a mensagem de registro a ser gravada quando o usuário der consentimento, por exemplo, Consent received.