خط‌مشی داده‌های مکان دقیق

انتخاب پلاتفرم: Android iOS Android (قدیمی)

اگر داده‌های مکان دقیق کاربران خود را به Google ارسال می‌کنید، خط‌مشی‌های ناشر Google الزامات کسب رضایت و اعلان را دراختیار شما قرار می‌دهد.

اگر این خط‌مشی برای شما اعمال می‌شود، مثال زیر عنوان، پیام، و نوشتار دکمه را تنظیم می‌کند تا کاربران را از هم‌رسانی داده‌ها مطلع کند:

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)

آبجکتیو-سی

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

جایگزین کردن موارد زیر:

  • ‫TITLE: عنوان کادر گفتگوی موافقت، برای نمونه، Location data.
  • ‫MESSAGE_TEXT: نوشتار کادر گفتگوی موافقت، برای مثال:

    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: نوشتار دکمه کادر گفتگوی موافقت، برای نمونه، OK.

  • ‫CONSENT_RECEIVED_LOG_MESSAGE: پیام گزارش برای ثبت کردن وقتی کاربر موافقت می‌کند، برای نمونه، Consent received.