אם אתם מעבירים ל-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.
CONSENT_RECEIVED_LOG_MESSAGE: הודעת היומן שצריך לתעד כשהמשתמש נותן הסכמה, לדוגמה,Consent received.