The app in the play store currently is configured to handle https://www.example.com/hello/
in an intent filter to launch an activity and showInstallPrompt(...)
is supposed to launch the activity once installation of the app is finished.
https://developer.android.com/topic/instant-apps/reference.html#public_methods
showInstallPrompt(...) Docs:
Shows a dialog that allows the user to install the current instant app. This method is a no-op if the current running process is an installed app. You must provide a post-install intent, which the system uses to start the application after install is complete.
postInstallIntent Docs:
The intent to launch after the instant app has been installed. This intent must resolve to an activity in the installed app package, or it will not be used.
I've tried doing this:
Uri uri = Uri.parse("https://www.example.com/hello/");
Intent postInstallIntent = new Intent("action", uri);
InstantApps.showInstallPrompt(MainActivity.this, postInstallIntent, 0, "InstantApp");
and this
Intent postInstallIntent = new Intent("https://www.example.com/hello/");
InstantApps.showInstallPrompt(MainActivity.this, postInstallIntent, 0, "InstantApp");
and this
Intent postInstallIntent = new Intent(Intent.ACTION_VIEW,
Uri.parse("https://www.example.com/hello/"))
.addCategory(Intent.CATEGORY_DEFAULT)
.addCategory(Intent.CATEGORY_BROWSABLE);
It brings me the the play store, but neither launches the app automatically once the install is completed.