مهم: ما دیگر ثبت نام های جدید برای Play EMM API را نمی پذیریم.
بیشتر بدانید .
اعلان های EMM را تنظیم کنید
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
Google Play در پاسخ به رویدادهای مختلفی که یک شرکت را تحت تأثیر قرار میدهند، اعلانهایی تولید میکند که به عنوان اعلانهای EMM نامیده میشوند. به عنوان مثال، هنگامی که یک برنامه تأیید می شود، سیستم یک اعلان ProductApprovalEvent
ارسال می کند.
اعلانهای EMM با یک حساب خدمات سازمانی خاص (ESA) مرتبط هستند. به عنوان یک EMM، میتوانید کنسول خود را طوری تنظیم کنید که بر اساس اعلانهایی که دریافت میکنید، هشدارها یا پیامها را برای مدیران فناوری اطلاعات سازمانی نمایش دهد.
اعلانهای EMM با استفاده از Google Cloud Pub/Sub ارسال میشوند. برای اطلاعات دقیق در مورد نحوه تنظیم اعلانهای Pub/Sub، به راهنمای کلی مشترک و Pull Subscriber مراجعه کنید.
برای تأیید اینکه سیستم خود را برای دریافت اعلانهای EMM از Google Play با موفقیت راهاندازی کردهاید و برای بازیابی نام موضوع Cloud Pub/Sub که باید اشتراک خود را به آن متصل کنید، با Enterprises.sendTestPushNotification
تماس بگیرید.
ارسال یک اعلان آزمایشی، ادغام EMM شما با سرویس Google Cloud Pub/Sub برای شرکت را تأیید میکند. اگر اعلانهای EMM به درستی پیکربندی شده باشند، API موارد زیر را برمیگرداند:
{
topic_name: "/projects/project-name/topics/play-work-012345",
message_id: "128976912439"
}
اعلان ها را بکشید
Google Cloud Pub/Sub از دو مکانیسم مختلف اعلان پشتیبانی می کند: کشیدن و فشار دادن. با این حال، فقط اعلان های کششی توصیه می شود. رویکرد کششی نیازی به راه اندازی سرور خارجی ندارد و با ESA های ایجاد شده به صورت برنامه نویسی و دستی کار می کند. مزیت دیگر اعلانهای کششی این است که به پیکربندی یا نگهداری اضافی توسط مشتریان شما نیازی ندارند. از Enterprises.pullNotificationSet
و Enterprises.acknowledgeNotificationSet
برای دریافت و تأیید اعلانهای EMM از طریق اتصالات خروجی طولانی مدت استفاده کنید.
هنگام فراخوانی Enterprises.pullNotificationSet
، توصیه میکنیم requestMode
به مقدار پیشفرض خود رها کنید ( waitForNotifications
). این باعث میشود که درخواست منتظر بماند تا یک یا چند اعلان قبل از بازگشت یک پاسخ وجود داشته باشد. اگر پس از مدتی هیچ اعلانی وجود نداشته باشد، درخواست یک لیست اعلان خالی را برمی گرداند و پس از آن می توانید دوباره درخواست را امتحان کنید.
پس از دریافت اعلانها، با Enterprises.acknowledgeNotificationSet
تماس بگیرید تا مطمئن شوید دفعه بعد که با Enterprises.pullNotificationSet
تماس میگیرید، همان اعلانها برگردانده نمیشود.
شما همچنین میتوانید هنگام تماس با Enterprises.pullNotificationSet
requestMode
برای returnImmediately
تنظیم کنید. در صورت عدم وجود اعلان، بلافاصله پاسخی به درخواست دریافت خواهید کرد که حاوی اعلانهای معلق یا یک لیست خالی است. این گزینه requestMode
ممکن است زمانی مفید باشد که در ابتدا اجرای اعلان های خود را آزمایش می کنید.
نمونه هایی از اعلان های EMM
در اینجا چند نمونه از رویدادها و انواع اعلان هایی که آنها ایجاد می کنند آورده شده است:
توجه: انواع اعلانهای زیر منسوخ شدهاند: ProductApprovalEvent
، AppUpdateEvent
، NewPermissionsEvent
، AppRestrictionsSchemaChangeEvent
، ProductAvailabilityChangeEvent
، و NewDeviceEvent
. برای AppUpdateEvent
، طبق توصیههای ما باید از حالت بهروزرسانی با اولویت بالا استفاده کنید.
توضیحات | اطلاع رسانی |
---|
یک اعلان آزمایشی از طریق Google Play EMM API درخواست میشود. برای تأیید اینکه سیستم شما میتواند اعلانهایی را که Google Play منتشر میکند دریافت کند و نام موضوع مورد استفاده برای همه اعلانهای مرتبط با Google Play را یاد بگیرید، باید یک اعلان آزمایشی ارسال کنید. | TestPushNotification |
دستگاهی که به تازگی ارائه شده است برای مدیریت توسط Google Play EMM API آماده است. اکنون میتوانید APIهایی را که به deviceId دستگاه نیاز دارند (مثلاً Installs ) و APIهایی که منبع Devices را برمیگردانند، فراخوانی کنید. این اعلان فقط پس از ارائه اولین حساب در یک دستگاه مدیریت شده ارسال می شود. منسوخ شده | NewDeviceEvent |
یک سرپرست، برنامهای را در کنسول مدیریتشده Google Play بهعنوان تأیید یا تأیید نشده علامتگذاری میکند. منسوخ شده | ProductApprovalEvent |
زمان نصب معلق در دستگاه به پایان می رسد. به عنوان مثال، درخواست نصب فشار پذیرفته می شود، اما دستگاه برای چندین روز قابل دسترسی نیست، بنابراین نصب نمی تواند تأیید شود. سیستم اعلان زمان نصب را ارسال می کند. | InstallFailureEvent |
نسخه جدیدی از یک اپلیکیشن منتشر شد. به روز رسانی برای یک یا چند دستگاه در دسترس است، اما نه لزوماً همه. منسوخ شده | AppUpdateEvent |
بهروزرسانی برنامه نیاز به مجوز جدیدی دارد تا توسط سرپرست تأیید شود تا بهروزرسانی یا نصب جدید انجام شود. این اعلان زمانی ارسال می شود که مجموعه مجوزهای پذیرفته شده برنامه با مجموعه مجوزهای درخواستی برنامه متفاوت باشد. منسوخ شده | NewPermissionsEvent |
نسخه جدیدی از یک برنامه منتشر شده است که شامل یک طرح پیکربندی مدیریت شده جدید یا اصلاح شده است. وقتی یک برنامهنویس یک APK جدید آپلود میکند، Google Play طرح موجود در مانیفست را با طرحی در نسخه قبلی برنامه مقایسه میکند. اگر طرحواره تغییر کرده باشد، به شرکت هایی که برنامه را تایید کرده اند اطلاع می دهد. منسوخ شده | AppRestrictionsSchemaChangeEvent |
یک برنامه در دسترس از دسترس خارج می شود یا یک برنامه در دسترس دوباره به Google Play اضافه می شود. اگر برنامهنویسی آن را لغو انتشار کند یا از Google Play حذف شود، در دسترس بودن برنامه تغییر میکند. در صورت اضافه شدن مجدد یک برنامه غیرقابل دسترس به Google Play، در دسترس بودن نیز تغییر می کند. منسوخ شده | ProductAvailabilityChangeEvent |
اعلان مربوط به ارتقاء سازمانی. ارتقای سازمانی فرآیندی است که یک شرکت حسابهای Google Play مدیریت شده را به دامنه مدیریتشده Google ارتقا میدهد. | EnterpriseUpgradeEvent |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eGoogle Play uses EMM notifications, sent via Google Cloud Pub/Sub, to inform enterprises of events like app approvals or new device provisioning.\u003c/p\u003e\n"],["\u003cp\u003eEMMs can configure their systems to display alerts to IT administrators based on these notifications.\u003c/p\u003e\n"],["\u003cp\u003ePull notifications are the recommended method for receiving EMM notifications, offering advantages in setup and maintenance.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eEnterprises.pullNotificationSet\u003c/code\u003e and \u003ccode\u003eEnterprises.acknowledgeNotificationSet\u003c/code\u003e are used to manage the retrieval and acknowledgment of EMM notifications.\u003c/p\u003e\n"],["\u003cp\u003eVarious notification types correspond to specific events, such as app updates, install failures, and new device provisioning, though some have been deprecated.\u003c/p\u003e\n"]]],[],null,["# Set up EMM notifications\n\nGoogle Play generates notifications, referred to as **EMM notifications** , in\nresponse to various events that affect an enterprise. For example, when an app\nis approved, the system sends a `ProductApprovalEvent` notification.\n\nEMM notifications are associated with a specific [enterprise service account\n(ESA)](/android/work/overview#service_accounts). As an EMM, you can set up your\nconsole to display alerts or messages to enterprise IT administrators based on\nthe notifications that you receive.\n\nEMM notifications are sent using [Google Cloud\nPub/Sub](//cloud.google.com/pubsub/overview). For detailed information on how to\nset up a Pub/Sub notifications, see the [Subscriber\nOverview](//cloud.google.com/pubsub/docs/subscriber) and [Pull Subscriber\nGuide](//cloud.google.com/pubsub/docs/pull).\n\nTo confirm that you have successfully set up your system to receive EMM\nnotifications from Google Play and to retrieve the name of the Cloud Pub/Sub\ntopic that you need to connect your subscription to, call\n[`Enterprises.sendTestPushNotification`](/android/work/play/emm-api/v1/enterprises/sendTestPushNotification).\n\nSending a test notification validates your EMM integration with the Google Cloud\nPub/Sub service for the enterprise. If EMM notifications are properly\nconfigured, the API returns the following: \n\n {\n topic_name: \"/projects/project-name/topics/play-work-012345\",\n message_id: \"128976912439\"\n }\n\nPull notifications\n------------------\n\nGoogle Cloud Pub/Sub supports two different notification mechanisms: pull and\npush. However, only pull notifications are recommended. The pull approach\ndoesn't require any external server setup, and works with both programmatically\nand manually created ESAs. Another advantage of pull notifications is that they\nrequire little to no additional configuration or maintenance by your customers.\nuse\n[`Enterprises.pullNotificationSet`](/android/work/play/emm-api/v1/enterprises/pullNotificationSet)\nand\n[`Enterprises.acknowledgeNotificationSet`](/android/work/play/emm-api/v1/enterprises/acknowledgeNotificationSet)\nto receive and acknowledge EMM notifications over long-running outgoing\nconnections.\n\nWhen calling\n[`Enterprises.pullNotificationSet`](/android/work/play/emm-api/v1/enterprises/pullNotificationSet),\nwe recommend leaving the `requestMode` to its default value\n(`waitForNotifications`). This causes the request to wait until one or more\nnotifications are present before returning a response. If no notifications are\npresent after some time, the request returns an empty notification list, after\nwhich you can try the request again.\n\nAfter you receive notifications, call\n[`Enterprises.acknowledgeNotificationSet`](/android/work/play/emm-api/v1/enterprises/acknowledgeNotificationSet)\nto ensure that the same notifications aren't returned the next time you call\n`Enterprises.pullNotificationSet`.\n\nYou also have the option of setting `requestMode` to `returnImmediately` when\ncalling `Enterprises.pullNotificationSet`. You'll receive a response to the\nrequest immediately, containing any pending notifications or an empty list if no\nnotifications are present. This `requestMode` option may be useful when you\ninitially test your notifications implementation.\n\nExamples of EMM notifications\n-----------------------------\n\nHere are some examples of events and the notification types that they generate:\n\n**Note:** The following notification types have been deprecated:\n`ProductApprovalEvent`, `AppUpdateEvent`, `NewPermissionsEvent`,\n`AppRestrictionsSchemaChangeEvent`, `ProductAvailabilityChangeEvent`, and\n`NewDeviceEvent`. For `AppUpdateEvent`, you must use\n[high-priority update mode](/android/work/play/emm-api/update) as\nper our recommendations.\n\n| Description | Notification |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|\n| A test notification is requested via the [Google Play EMM API](/android/work/play/emm-api/v1/enterprises/sendTestPushNotification). You need to send a test notification to confirm that your system can receive the notifications that Google Play publishes, and to learn the topic name used for all notifications associated with Google Play. | `TestPushNotification` |\n| A newly provisioned device is ready to be managed by the [Google Play EMM API](/android/work/play/emm-api/v1). You can now call APIs that require the device's `deviceId` ([Installs](/android/work/play/emm-api/v1/installs), for example) and APIs that return a [Devices](/android/work/play/emm-api/v1/devices) resource. This notification is only sent after the first account is provisioned on a managed device. **DEPRECATED** | `NewDeviceEvent` |\n| An administrator marks an application as approved or unapproved in the managed Google Play console. **DEPRECATED** | `ProductApprovalEvent` |\n| A pending installation to a device times out. For example, a push install request is accepted, but the device is not reachable for several days, so the install cannot be confirmed. The system sends an install timeout notification. | `InstallFailureEvent` |\n| A new version of an app is published. The update is available to one or more, but not necessarily all, devices. **DEPRECATED** | `AppUpdateEvent` |\n| An app update requires a new permission to be approved by the admin, so that an update or a new install can occur. This notification is sent when the application's accepted permission set differs from the application's requested permissions set. **DEPRECATED** | `NewPermissionsEvent` |\n| A new version of an app is published that includes a new or modified [managed configurations schema](//developer.android.com/work/managed-configurations.html# define-configuration). When a developer uploads a new APK, Google Play compares the schema in the manifest to the schema in the previous version of the app. If the schema has changed, it notifies enterprises that have approved the app. **DEPRECATED** | `AppRestrictionsSchemaChangeEvent` |\n| An available app becomes unavailable, or an unavailable app is re-added to Google Play. The availability of the app changes if a developer unpublishes it, or it is removed from Google Play. The availability also changes if an unavailable app is re-added to Google Play. **DEPRECATED** | `ProductAvailabilityChangeEvent` |\n| A notification related to an enterprise upgrade. An enterprise upgrade is a process that upgrades a managed Google Play Accounts enterprise to a managed Google Domain. | `EnterpriseUpgradeEvent` |"]]