Support app management

You can install Android apps from the Google Play Store on devices via policy. To support this feature, include an app's package name in a policy. Android apps are uniquely identified by their package names. You can find an app's package name by visiting the Google Play Store. For example, the URL of the Google Chrome app page is shown below. The app's package name is com.android.chrome.

https://play.google.com/store/apps/details?id=com.android.chrome

When you apply the policy to a device, the app will either be installed on the device or added to the managed Play Store on the device.


Managed Google Play iframe

managed-play-iframe
Figure 1. Managed Google Play iframe

Embedding the managed Google Play iframe allows IT admins to browse Android apps without leaving your EMM console. When an IT admin selects an app, you can retrieve the app's package name to include it in a policy.

Add the iframe to your console

Step 1. Generate a web token

Call enterprises.webTokens.create to generate a web token that identifies the enterprise. Set parentFrameUrl to the URL of the parent frame hosting the iframe. The response contains the token's value.

Step 2. Render the iframe

Here's an example of how to render the managed Play iframe:

<script src="https://apis.google.com/js/api.js"></script>
<div id="container"></div>
<script>
  gapi.load('gapi.iframes', function() {
    var options = {
      'url': 'https://play.google.com/work/embedded/search?token=web_token',
      'where': document.getElementById('container'),
      'attributes': { style: 'width: 600px; height:1000px', scrolling: 'yes'}
    }

    var iframe = gapi.iframes.getContext().openChild(options);
  });
</script>

This code generates an iframe inside the container div. Attributes to be applied to the iframe tag can be set with the 'attributes' option, as above.

URL parameters

The table below lists all the available parameters for the iframe that can be added to the URL as URL parameters, e.g:

'url': 'https://play.google.com/work/embedded/search?token=web_token&mode=SELECT&showsearchbox=TRUE',
Parameter Required Description
token Yes The token returned from Step 1.
mode No APPROVE (default): lets IT admins select, approve, and un-approve apps.
SELECT: lets IT admins select apps.
showsearchbox No TRUE (default): displays the search box and initiates the search query from within the iframe.
FALSE: the search box is not displayed.
search No Search string. If specified, the iframe directs the IT admin to search results with the specified string.
locale No A well-formed BCP 47 language tag that is used to localize the content in the iframe. If not specified, the default value is en_US.

Step 3. Handle iframe events

You should also handle the following events as part of your integration.

EventDescription
onproductselect The user selects or approves an app. This returns an object containing:
{
    "productId": The ID of the product (app), e.g. "app:com.google.android.gm"
    "action": The type of action performed on the document. Possible values are:
    "approved", "unapproved" or "selected." If you implement the iframe in SELECT
    mode, the only possible value is "selected."
}
    
The sample below shows how to listen for onproductselect:
iframe.register('onproductselect', function(event) {
  console.log(event);
}, gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER);


Upload your own app to the Google Play Store

If you or your customer develop an Android app, you can upload it on the Play Store using the Google Play Console.

If you don’t want the app to be publicly available on the Play Store, you can restrict your app to a single enterprise using Google Play Console. Another option is to publish a private app programmatically using the Google Play Custom App Publishing API. Private apps are only available to the enterprise they are restricted to. They can still be installed via a policy, but are not be visible to users outside your enterprise.

Send feedback about...

Android Management API
Android Management API