Google+ Platform

Android app installs from your web site

By adding the Google+ Sign-In button to your web site, you can automatically prompt your users to download your Android app over the air to their Android devices. To enable this feature, you must use the same Google Developers Console project for your Web and Android clients, and configure your web app's sign-in button.

App requirements

For your app to be eligible for this feature, it must be published in the Google Play store, be free, and it must meet a quality threshold. This threshold is determined by Google and is subject to change. New apps might take some time to surpass the quality threshold.

Configure your Google Developers Console project

Google uses the Google Developers Console to configure access for apps to communicate with the Google APIs. For direct app installs, you must use the same project for your Web and Android apps. This configuration also enables deep linking feature so you should include your iOS app in the same project.

  1. Go to the Google Developers Console.

  2. Select a project or create a new one.

  3. In the sidebar on the left, select APIs & auth, enable the Google+ API and any other APIs that your apps require.
  4. In the Registered apps pane, you will register each app for each supported platform that you want to integrate Google+ services, including direct app installs and deep linking. If you have multiple Android apps, the order that you define your client IDs determine which app is installed.
    1. For the Android app that you want your users to be prompted to download, click Register app. Choose Installed application and Android as the application type. Refer to the quick start for additional details about this step.
    2. For your web app, register another app and select Web application as the type. Refer to the quick start for additional details about this step.
    3. If you have additional clients, such as a paid version of your Android app or an iOS app, create OAuth 2.0 client IDs for those apps by registering these apps in this same project as well. This grouping enables deep linking to work across your mobile apps if you enable it for your client IDs.

Configure your web app

Your web app must use the Google+ Sign-In button to prompt your web site users to download your app the first time that they sign in. This feature is enabled by adding the apppackagename parameter to your sign-in button.

  1. Add a sign-in button to your app using either the HTML button or programmatically using the gapi.signin.render() JavaScript method or you can initiate the flow with the gapi.auth.signIn() method.
  2. Add the data-apppackagename parameter to your HTML button or the apppackagename parameter to your object parameters. Specify your Android app's package name as the value. This value should be the same as the value that you entered in the Google Developers Console for the Android app that you want your users to download.
  3. If you previously authorized the app for your account, you need to disconnect the app before you can try out the direct app install.
  4. Refresh your web app to pick up the change to the apppackagename parameter.
  5. Test your automatic app install by visiting your web app and clicking the sign-in button. First, you should see the authorization dialog. After accepting the authorization dialog, you will see the direct app install prompt.

An example dialog
  showing the layout of the direct app install window, which includes a
  drop-down menu to select which device to install the app on.

Testing Android app installs for your web site

If your app meets the eligibility requirements, you can test the over-the-air install feature by signing in to your app for the first time with your account. If you want to test subsequent app installs, you will need to follow these steps:

  1. Revoke your accounts access tokens for the app. The developer policies require that your app provide users with an option to revoke access from within your app. You can also manually disconnect and revoke tokens.
  2. Uninstall the app from all of the Android devices where you use the app and signed into it with this account.
  3. Wait for at least 30 minutes to test the sign-in flow from your web app to try to trigger the app install prompt.