إذا كنت تنقل بيانات الموقع الجغرافي الدقيق للمستخدمين إلى Google، ستوفّر لك سياسات الناشرين في Google متطلبات الموافقة والإشعار.
إذا كانت هذه السياسة تنطبق عليك، يضبط المثال التالي العنوان والرسالة ونص الزر لإعلام المستخدمين بمشاركة البيانات:
Kotlin
protectedfunpresentConsentOverlay(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)
جافا
protectedvoidpresentConsentOverlay(Contextcontext){newAlertDialog.Builder(context).setTitle("TITLE").setMessage("MESSAGE_TEXT").setNeutralButton("BUTTON_TEXT",newDialogInterface.OnClickListener(){@OverridepublicvoidonClick(DialogInterfacedialog,intwhich){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
تاريخ التعديل الأخير: 2026-10-03 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2026-10-03 (حسب التوقيت العالمي المتفَّق عليه)"],[],["Google's updated Publisher Policies require publishers to notify users about sharing precise location data for ads. Publishers must obtain user consent for this data sharing. Example code snippets in Kotlin and Java are provided to show how to inform users via a consent overlay. The code displays a message stating that the app may use and share user location for personalized advertising, analytics, and attribution, and directs users to the privacy policy for further information. Customization of the provided code is needed.\n"]]