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

Google पब्लिशर से जुड़ी नीतियों में हाल ही में हुए अपडेट में, उन पब्लिशर के लिए नई सूचना और सहमति से जुड़ी ज़रूरी शर्तें शामिल की गई हैं जो विज्ञापन के मकसद से, उपयोगकर्ताओं की जगह की सटीक जानकारी Google को भेजते हैं.

अगर यह नीति आप पर लागू होती है, तो नीचे दिया गया स्निपेट एक ऐसा तरीका दिखाता है जिससे आप अपने उपयोगकर्ताओं को इस डेटा शेयर करने के बारे में जानकारी दे सकते हैं:

Java

protected void presentConsentOverlay(Context context) {
  new AlertDialog.Builder(context)
      .setTitle("Location data")
      .setMessage("We may use your location, " +
          "and share it with third parties, " +
          "for the purposes of personalized advertising, " +
          "analytics, and attribution. " +
          "To learn more, visit our privacy policy " +
          "at https://myapp.com/privacy.")
  .setNeutralButton("OK", new DialogInterface.OnClickListener() {
    @Override
    public void onClick(DialogInterface dialog, int which) {
      dialog.cancel();
      // TODO: replace the below log statement with code that specifies how
      // you want to handle the user's acknowledgement.
      Log.d("MyApp", "Got consent.");
    }
  })
  .show();
}

// To use the above method:
presentConsentOverlay(this);

Kotlin

protected fun presentConsentOverlay(context: Context) {
  AlertDialog.Builder(context)
      .setTitle("Location data")
      .setMessage("We may use your location, " +
          "and share it with third parties, " +
          "for the purposes of personalized advertising, " +
          "analytics, and attribution. " +
          "To learn more, visit our privacy policy " +
          "at https://myapp.com/privacy.")
      .setNeutralButton("OK") { dialog, which ->
        dialog.cancel()
        // TODO: replace the below log statement with code that specifies how
        // you want to handle the user's acknowledgement.
        Log.d("MyApp", "Got consent.")
      }
      .show()
}

// To use the above function:
presentConsentOverlay(this)