जगह की सटीक जानकारी के डेटा से जुड़ी नीति

प्लैटफ़ॉर्म चुनें: Android iOS Unity 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)

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.