تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
بالنسبة إلى حالات الاستخدام، مثل عرض الإحصاءات أو منع الاحتيال على جهاز معيّن، قد تحتاج إلى ربط الاستخدام أو الإجراءات بمجموعة من التطبيقات التي تمتلكها مؤسستك. توفّر خدمات Google Play خيارًا يحافظ على الخصوصية يُعرف باسم معرّف مجموعة التطبيقات.
نطاق معرّف مجموعة التطبيقات
يمكن أن يتضمّن معرّف مجموعة التطبيقات أحد النطاقات المحدّدة التالية. لتحديد النطاق المرتبط بمعرّف معيّن، استخدِم الدالة getScope().
نطاق المطوِّر على Google Play
بالنسبة إلى التطبيقات التي يتم تثبيتها من خلال "متجر Google Play"، تعرض واجهة برمجة التطبيقات لمعرّف مجموعة التطبيقات معرّفًا محدد النطاق لمجموعة التطبيقات المنشورة ضمن حساب المطوّر نفسه على Google Play.
على سبيل المثال، لنفترض أنّك تنشر تطبيقَين ضمن حساب المطوِّر الخاص بك على Google Play، وتم تثبيت كلا التطبيقَين على الجهاز نفسه من خلال "متجر Google Play". تتشارك التطبيقات رقم تعريف مجموعة التطبيقات نفسه على هذا الجهاز. ويظل المعرّف كما هو حتى إذا تم توقيع التطبيقات باستخدام مفاتيح مختلفة.
نطاق التطبيق
في أيّ من الحالات التالية، تعرض حزمة تطوير البرامج (SDK) لمعرّف مجموعة التطبيقات معرّفًا فريدًا للتطبيق الذي تم استدعاؤه على جهاز معيّن:
يتم تثبيت التطبيق من خلال أداة تثبيت غير "متجر Google Play".
تعذّر على "خدمات Google Play" تحديد حساب المطوّر على Google Play الخاص بأحد التطبيقات.
التطبيق مثبَّت على جهاز لا تتوفّر فيه "خدمات Google Play".
عدم الاعتماد على قيمة مخزَّنة مؤقتًا لمعرّف مجموعة التطبيقات
يمكن إعادة ضبط رقم تعريف مجموعة التطبيقات لمجموعة معيّنة من التطبيقات المثبَّتة من "متجر Google Play" على أحد الأجهزة في أيّ من الحالات التالية:
لم يتم الوصول إلى واجهة برمجة التطبيقات لمعرّف مجموعة التطبيقات من قِبل مجموعات التطبيقات التي تشترك في قيمة المعرّف نفسها لمدة تزيد عن 13 شهرًا.
يتم إلغاء تثبيت آخر تطبيق من مجموعة معيّنة من التطبيقات من الجهاز.
يُجري المستخدم عملية إعادة ضبط الجهاز على الإعدادات الأصلية.
يجب أن يستخدم تطبيقك حزمة SDK لاسترداد قيمة المعرّف في كل مرة تكون هناك حاجة إليها.
إضافة حزمة تطوير البرامج (SDK) لمعرّف مجموعة التطبيقات إلى تطبيقك
يعرض المقتطف التالي مثالاً لملف build.gradle يستخدم مكتبة معرّف مجموعة التطبيقات:
يوضّح مقتطف الرمز البرمجي النموذجي التالي كيفية استرداد معرّف مجموعة التطبيقات بشكل غير متزامن باستخدام Tasks API في "خدمات Google Play":
Kotlin
valclient=AppSet.getClient(applicationContext)asAppSetIdClientvaltask:Task<AppSetIdInfo>=client.appSetIdInfoasTask<AppSetIdInfo>task.addOnSuccessListener({// Determine current scope of app set ID.valscope:Int=it.scope// Read app set ID value, which uses version 4 of the// universally unique identifier (UUID) format.valid:String=it.id})
Java
Contextcontext=getApplicationContext();AppSetIdClientclient=AppSet.getClient(context);Task<AppSetIdInfo>task=client.getAppSetIdInfo();task.addOnSuccessListener(newOnSuccessListener<AppSetIdInfo>(){@OverridepublicvoidonSuccess(AppSetIdInfoinfo){// Determine current scope of app set ID.intscope=info.getScope();// Read app set ID value, which uses version 4 of the// universally unique identifier (UUID) format.Stringid=info.getId();}});
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-09-05 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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"]],["تاريخ التعديل الأخير: 2025-09-05 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["For use cases such as analytics or fraud prevention on a given device, you may\nneed to correlate usage or actions across a set of apps owned by your\norganization. [Google Play services](https://developers.google.com/android)\noffers a privacy-friendly option called [*app set ID*](https://developers.google.com/android/reference/com/google/android/gms/appset/AppSetIdInfo).\n\nApp set ID scope\n\nThe app set ID can have one of the following defined scopes. To determine which\nscope a particular ID is associated with, call\n[`getScope()`](https://developers.google.com/android/reference/com/google/android/gms/appset/AppSetIdInfo#getScope()).\n| **Caution:** When Google Play services updates from a version that only supports app scope to a version that supports developer scope, the app set ID's value is reset automatically, without any developer action. See [other reasons developers\n| shouldn't rely on a cached value of the app set ID](#dont-rely-on-cached-value).\n\nGoogle Play developer scope **Note:** The app set SDK attempts to return app set IDs that have the developer scope without any additional developer action, unless the app satisfies the conditions for app scope, described below.\n\nFor apps that are installed by the Google Play store, the app set ID API returns\nan ID scoped to the set of apps published under the same Google Play developer\naccount.\n\nFor example, suppose you publish two apps under your Google Play developer\naccount and both apps are installed on the same device through the Google Play\nstore. The apps share the same app set ID on that device. The ID is the same\neven if the apps are signed by different keys.\n\nApp scope\n\nUnder any of the following conditions, the app set ID SDK returns an ID unique\nto the calling app itself on a given device:\n\n- The app is installed by an installer other than the Google Play store.\n- Google Play services is unable to determine an app's Google Play developer account.\n- The app is installed on a device without Google Play services.\n\nDon't rely on a cached value of app set ID\n\nUnder any of the following conditions, the app set ID for a given set of Google\nPlay store-installed apps on a device can be reset:\n\n- The app set ID API hasn't been accessed by the groups of apps that share the same ID value for over 13 months.\n- The last app from a given set of apps is uninstalled from the device.\n- The user performs a factory reset of the device.\n\nYour app should use the SDK to retrieve the ID value every time it's needed.\n\nAdd the app set ID SDK to your app\n\nThe following snippet shows an example `build.gradle` file that uses the app set\nID library: \n\n dependencies {\n implementation 'com.google.android.gms:play-services-appset:16.1.0'\n }\n\nThe following sample snippet demonstrates how you can retrieve the app set ID\nasynchronously using the [Tasks\nAPI](https://developers.google.com/android/guides/tasks) in Google Play\nservices: \n\nKotlin \n\n```kotlin\nval client = AppSet.getClient(applicationContext) as AppSetIdClient\nval task: Task\u003cAppSetIdInfo\u003e = client.appSetIdInfo as Task\u003cAppSetIdInfo\u003e\n\ntask.addOnSuccessListener({\n // Determine current scope of app set ID.\n val scope: Int = it.scope\n\n // Read app set ID value, which uses version 4 of the\n // https://en.wikipedia.org/wiki/Universally_unique_identifier.\n val id: String = it.id\n})\n```\n\nJava \n\n```java\nContext context = getApplicationContext();\nAppSetIdClient client = AppSet.getClient(context);\nTask\u003cAppSetIdInfo\u003e task = client.getAppSetIdInfo();\n\ntask.addOnSuccessListener(new OnSuccessListener\u003cAppSetIdInfo\u003e() {\n @Override\n public void onSuccess(AppSetIdInfo info) {\n // Determine current scope of app set ID.\n int scope = info.getScope();\n\n // Read app set ID value, which uses version 4 of the\n // https://en.wikipedia.org/wiki/Universally_unique_identifier.\n String id = info.getId();\n }\n});\n```"]]