ユーザーの正確な位置情報データを Google に渡す場合は、Google パブリッシャー向けポリシーに同意に関する要件と通知が記載されています。
このポリシーが適用される場合は、次の例のように、タイトル、メッセージ、ボタンのテキストを設定して、データ共有についてユーザーに通知します。
Kotlin
protected fun presentConsentOverlay(context: Context) { AlertDialog.Builder(context) .setTitle("TITLE") .setMessage("MESSAGE_TEXT") .setNeutralButton("BUTTON_TEXT") { dialog, which -> dialog.cancel() Log.d("APP_TAG", "CONSENT_RECEIVED_LOG_MESSAGE") } .show() } // To use the previous function, call: presentConsentOverlay(this)
Java
protected void presentConsentOverlay(Context context) { new AlertDialog.Builder(context) .setTitle("TITLE") .setMessage("MESSAGE_TEXT") .setNeutralButton("BUTTON_TEXT", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); Log.d("APP_TAG", "CONSENT_RECEIVED_LOG_MESSAGE"); } }) .show(); } // To use the previous method, call: presentConsentOverlay(this);
次のように置き換えます。
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)。APP_TAG: アプリケーションのログタグ(例:MainActivity)。CONSENT_RECEIVED_LOG_MESSAGE: ユーザーが同意したときに記録するログメッセージ(例:Consent received)。