重要: Play EMM API の新しい登録受け付けは終了しました。
詳細
EMM 通知を設定する
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Google Play は、企業に影響するさまざまなイベントに応じて、EMM 通知と呼ばれる通知を生成します。たとえば、アプリが承認されると、システムは ProductApprovalEvent
通知を送信します。
EMM 通知は、特定のエンタープライズ サービス アカウント(ESA)に関連付けられています。EMM は、受信した通知に基づいて企業の IT 管理者にアラートやメッセージを表示するようにコンソールを設定できます。
EMM 通知は Google Cloud Pub/Sub を使用して送信されます。Pub/Sub 通知を設定する方法について詳しくは、サブスクライバーの概要と pull サブスクライバー ガイドをご覧ください。
Google Play から EMM 通知を受信するようにシステムが正常に設定されていることを確認し、サブスクリプションを接続する必要がある Cloud Pub/Sub トピックの名前を取得するには、Enterprises.sendTestPushNotification
を呼び出します。
テスト通知を送信すると、企業の Google Cloud Pub/Sub サービスとの EMM の統合が検証されます。EMM 通知が正しく構成されている場合、API は次を返します。
{
topic_name: "/projects/project-name/topics/play-work-012345",
message_id: "128976912439"
}
通知を pull する
Google Cloud Pub/Sub は、pull と push の 2 つの異なる通知メカニズムをサポートしています。ただし、プル通知のみをおすすめします。プル アプローチでは、外部サーバーの設定は必要ありません。プログラムで作成された ESA と手動で作成された ESA の両方で機能します。プル通知のもう 1 つの利点は、お客様による追加の構成やメンテナンスがほとんど必要ないことです。Enterprises.pullNotificationSet
と Enterprises.acknowledgeNotificationSet
を使用して、長時間実行される送信接続を介して EMM 通知を受信して確認します。
Enterprises.pullNotificationSet
を呼び出す場合は、requestMode
をデフォルト値(waitForNotifications
)のままにすることをおすすめします。これにより、1 つ以上の通知が存在するまでリクエストが待機し、レスポンスが返されます。しばらく経っても通知がない場合、リクエストから空の通知リストが返されます。その後、リクエストをもう一度試すことができます。
通知を受け取ったら、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 で管理できる状態になります。デバイスの deviceId を必要とする API(Installs など)と、Devices リソースを返す API を呼び出せるようになりました。この通知は、管理対象デバイスに最初のアカウントがプロビジョニングされた後にのみ送信されます。非推奨 | NewDeviceEvent |
管理者は、managed Google Play Console でアプリを承認済みまたは未承認としてマークします。非推奨 | ProductApprovalEvent
|
デバイスへのインストールが保留中のままタイムアウトします。たとえば、プッシュ インストール リクエストは承認されたものの、デバイスに数日間アクセスできないため、インストールを確認できない場合です。システムからインストール タイムアウトの通知が送信されます。 | InstallFailureEvent
|
アプリの新しいバージョンが公開されます。アップデートは 1 台以上のデバイスで利用できます(すべてのデバイスで利用できるとは限りません)。非推奨 | AppUpdateEvent
|
アプリの更新では、更新または新規インストールを実行できるように、新しい権限を管理者が承認する必要があります。この通知は、アプリが承認した権限セットが、アプリがリクエストした権限セットと異なる場合に送信されます。非推奨 | NewPermissionsEvent |
新しいバージョンまたは変更されたマネージド構成スキーマを含むアプリの新しいバージョンが公開されます。デベロッパーが新しい APK をアップロードすると、Google Play はマニフェスト内のスキーマを以前のバージョンのアプリのスキーマと比較します。スキーマが変更されている場合は、アプリを承認した企業に通知します。非推奨 |
AppRestrictionsSchemaChangeEvent |
利用可能なアプリが利用できなくなったり、利用できないアプリが Google Play に再び追加されたりする。デベロッパーがアプリの公開を停止した場合、またはアプリが Google Play から削除された場合、アプリの公開状況は変わります。公開されていないアプリが Google Play に再び追加された場合も、公開状況は変更されます。非推奨 |
ProductAvailabilityChangeEvent |
エンタープライズ アップグレードに関する通知。エンタープライズ アップグレードとは、managed Google Play アカウント エンタープライズを Managed Google Domains にアップグレードするプロセスです。 |
EnterpriseUpgradeEvent |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-31 UTC。
[null,null,["最終更新日 2025-08-31 UTC。"],[[["\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` |"]]