5 tips for using showInstallPrompt in your instant experience

This animation shows the installation flow when using showInstallPrompt

1. Make sure you’re using the latest showInstallPrompt API

Rolled out in June 2018, the updated showInstallPrompt API gains a few key benefits over the legacy API. The new API displays a smaller install prompt and improves the transition to your installed app with the addition of the postInstallIntent parameter, which specifies the activity to launch after installation.

Identifying the showInstallPrompt version in your instant experience

Previously, the legacy API would launch a larger in-app install prompt. Due to the legacy showInstallPrompt deprecation, now calling it launches your Play Store listing. In order to restore in-app install prompts, you’ll need to migrate to the new API.

public static boolean showInstallPrompt (Activity activity, Intent postInstallIntent, int requestCode, String referrer)

Migrating to the new showInstallPrompt

To migrate to the new showInstallPrompt API, follow these steps:

implementation 'com.google.android.gms:play-services-instantapps:16.0.1'

2. Pre-register from within your instant game

The showInstallPrompt API is not just for installation! If your instant game supports pre-registration, you can prompt for pre-registration signup using the same API.

// Prompt for pre-registration
InstantApps.showInstallPrompt(activity, postInstallIntent, requestId, referrerId)

3. Transition user state to the installed app

Transfer the user’s state from the instant experience into the installed app. Users should be able to pick up where they left off. Any achievements or progress made in the instant experience should carry over to the installed app or game.

4. Don’t interfere with task completion

Users shouldn’t be interrupted when working through the tasks they sought to complete when opening the instant experience. Avoid asking users to install your app when they’re partially completed with a task.

5. Provide explicit installation prompts

This last tip may seem obvious, but make sure your instant experience has explicit install prompts. Without them, users may be confused on how to install your app or may have to go to the Play Store to install.


Android Developers

The official Android Developers publication on Medium

Miguel Montemayor

Written by

Developer Advocate at Google

Android Developers

The official Android Developers publication on Medium