המדיניות בנושא נתוני מיקום מדויק

אם אתם מעבירים ל-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)

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

מחליפים את מה שכתוב בשדות הבאים:

  • ‫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.