Search code examples
android-management-api

How to know (server-side) when a device get enrolled?


Is there a way to know in real-time when a device get actually enrolled on an Android Management EMM solution?

In the official documenation it's suggeted an example of license checking that should work by setting a policy to the a new device within 5 minutes of the enrollment, otherwise the API will proceed with a factory reset. But how to know from server side when the device was actually enrolled? The API seems to lack any sort of callback/webhook.

This is the scenario I'm trying to solve:

  1. The EMM admin generate an enrollement URL and send it to a new employee via email
  2. The new employee read the email after some time and start the enrollment process on their BYOD device
  3. The enrollment proccess completes, but since there isn't any callback, the EMM server can't know a new device was enrolled

The only possible solution I can imagine is to periodically call the enterprises.devices.list API to check for new devices, but it seems too inefficient to me.

Am I missing something?

Thanks.


Solution

  • Setup the Pub/Sub notifications, as explained here. You'll then receive a message from the Android Management API when a device enrolls.