0

I have an InstantApp in internal test on the Play Store - not published. The instant app downloads and operates fine. The activity presents an Install button which appears to work fine - The Play Store presents its page with an Install button; clicking it downloads 1.25MB and the app's icon appears in the App Screen. The app appears in All Apps as 4.0MB. When executed, it displays the InstantApp, however.

If I sideload the app (AS3.2 Canary 14), a Chooser is displayed with two entries for my app plus Chrome - even after I Uninstalled both the Instant and the Installed. If I choose the bottom of the two, the full app is run fine. The app that appears now in All Apps is 17MB.

If I trigger the app again, there is a Chooser to open one instance (Just Once/Always) or Use a different app (which includes the other instance). If I choose the upper Just Once, the Instant App is run. If I choose the lower, the full is run.

So both the instant and full apps work fine. But how can I get the full app to be downloaded upon Install, instead of only on sideloading? If that is fixed, how do I get the postInstallIntent to execute it? And can I halt the appearance of the InstantApp in the Chooser?

The device is V7.1.1, so this is not the O install problem in 45206096. The URL mappings use pathPattern /i/.* for https only and the default-urls are domain/i/.

Here is the code in the onClickListener of the Install Button:

Uri uri = Uri.parse(getPackageName()+".full.TestFull");
Intent postInstallIntent = new Intent(Intent.ACTION_VIEW, uri);
postInstallIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK Intent.FLAG_ACTIVITY_CLEAR_TASK);
boolean promptresult = InstantApps.showInstallPrompt(InstantActivity.this,postInstallIntent, 0, "InstantApp");

promptResult is true but the full app is not downloaded and the activity in the Intent is not executed.

P.S. I have tried changing the module from pkg.full to just pkg and not prepending ".full" to the activity in the intent uri to no avail.

TIA for any advice.

TWL
  • 6,228
  • 29
  • 65
JAW
  • 187
  • 2
  • 13
  • On a pre-O device, the system doesn't automatically replace the instant-app when you sideload the installed-app. You need to remove the AIA before you install the installed-app. If you are building/installing from AS, please also see: https://issuetracker.google.com/issues/63932235 – TWL Jun 11 '18 at 17:21
  • Yes, but that is not my problem. Sideloading the app simply verified its size was larger than the AIA and that it worked. – JAW Jun 11 '18 at 17:45
  • Okay, you got a few different questions going on, installprompt won't work if you don't have a published app; the postinstallintent is an URL from the example: https://github.com/googlesamples/android-instant-apps/blob/master/install-api/features/install/src/main/java/com/instantappsamples/feature/install/InstallApiActivity.kt – TWL Jun 11 '18 at 17:53
  • The IA choose is happening, I assume, because you have both aia and installed-app installed at the same time? For pre-O, you will have to manually uninstall the aia before sideloading the installed-app to replicate the live experience, or use the method from that link I provided. – TWL Jun 11 '18 at 17:55
  • So the closest I can test the installed-app is what I have done. All that is left is to publish it (in an alpha?) and it will just work? I can't trigger the Install process from the AIA without having the Instant installed, right? – JAW Jun 11 '18 at 18:01
  • Correct, without a listing, the installprompt can't go anywhere. And without a complete path from the AIA to the Store, the postinstallintent can't happen, but the postinstallintent is essentially the Store firing the URL intent for you. Please also see https://stackoverflow.com/questions/47603099/android-instant-app-showinstallprompts-postinstallintent-does-nothing https://stackoverflow.com/questions/48285281/opening-google-play-in-popup-like-vimeo-wisher-buzzfeed-instant-app/48288676#48288676 – TWL Jun 11 '18 at 18:39
  • Thanks, I have seen both those pointers multiple times but I needed your explanation. When you say the installprompt can't go anywhere without a listing, it looks like Play Store then, by default, downloads the instant app instead. That would fit what I am seeing. – JAW Jun 11 '18 at 19:10

0 Answers0