Política de datos de ubicación precisa

Selecciona la plataforma: Android iOS Unity Android (heredada)

Si pasas datos de ubicación precisos de tus usuarios a Google, las Políticas para Publicadores de Google te proporcionan requisitos de consentimiento y un aviso.

Si esta política se aplica a ti, en el siguiente ejemplo, se establece el título, el mensaje y el texto del botón para informar a los usuarios sobre el uso compartido de datos:

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];

Reemplaza lo siguiente:

  • TITLE: Es el título del cuadro de diálogo de consentimiento, por ejemplo, Location data.
  • MESSAGE_TEXT: Es el texto del cuadro de diálogo de consentimiento, por ejemplo:

    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: Es el texto del botón del cuadro de diálogo de consentimiento, por ejemplo, OK.

  • CONSENT_RECEIVED_LOG_MESSAGE: Es el mensaje de registro que se registra cuando el usuario otorga el consentimiento, por ejemplo, Consent received.