Discover and approve apps

You can use a policy to install Android apps from the Google Play Store on devices. To support this feature, include an app's package name in a policy. When you apply the policy to a device, the app is automatically approved for the enterprise and installed on the device.

Android apps are uniquely identified by their package names. You can find an app's package name by visiting the Google Play Store, or if you expose a management console to your customers, you can integrate the Google Play iframe in the console so that enterprise administrators can search for apps without leaving your console. You can then use the package name in a policy to install the app on a device.

If you need to install a custom app that you or your customer developed on a device, you can add the app to the Play Store and optionally restrict its visibility to a single enterprise.

Google Play Store

You can explore the Play Store on the web to find Android apps. When you click on an app, its package name is included as the id parameter in the URL of the page. 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

If you manage devices for another organization, make sure your customer is aware of the apps you install on their devices and all the permissions they require.

Google Play iframe

Recommended for Enterprise Mobility Management (EMM) providers

If you offer a management console to enterprise admins, you can integrate the Play iframe into your console. The iframe lets admins search for and approve apps for their enterprise without leaving your console.

To display the Play iframe, you first need to generate a token using enterprises.webTokens.create. Set parentFrameUrl to the URL of the parent frame hosting the iframe, and add the APPROVE_APPS permission to allow users to approve apps directly from the iframe. The response contains the token’s value.

Next, render the iframe on your web page putting the token in the URL.

<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 should be added to the URL as URL parameters, e.g:

'url': 'https://play.google.com/work/embedded/search?token=web_token&mode=APPROVE&showsearchbox=true',
Parameter Required Description
token Yes The token returned from the createWebToken API.
mode No APPROVE (default value) lets the administrator select, approve, and un-approve an app. SELECT lets the administrator select an app.
showsearchbox No If TRUE (default value), displays the search box and initiates the search query from within the iframe. If FALSE, the search box is not displayed.
search No If specified, the iframe directs the administrator to search results with the specified string. Only include this parameter when the search box is located outside of the iframe (showsearchbox = FALSE).
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.

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 (beta)
Android Management API (beta)