Android instant app with Internal testing

414 Views Asked by At

I want to distribute my app as both normal and instant app on Google Play, the size of the normal bundle is below 10Mb so it can also be an instant app.

I followed google's guide to build instant apps with bundles (https://developer.android.com/topic/google-play-instant/getting-started/instant-enabled-app-bundle#test-from-studio).

Basically I created two bundles, one with the installable app (version code 1000) and one with the manifest configurations for instant app (targetSandboxVersion=2 and <dist:module dist:instant="true" /> version code 1).

I also did the configuration for the verified app links, so deeplinking in the installable app works just fine.

I uploaded both bundles to my internal test track, I invited myself as a tester. I can see the installable app on my phone, I can install it just fine, but the problem is that I cannot see the instant app, if I open the url for the instant app build from my phone, PlayStore app is getting stuck in a loading screen. Also the "Try now" button if I open the details of my app internal testing app.

I have Google play instant and internal app sharing active. I tried everything I could find online, nothing seems to work.

Any ideas what I am doing wrong? Thanks in advance.

3

There are 3 best solutions below

1
On BEST ANSWER

For anyone having the same issue, I promoted my release to a Closed release, the app went throw the google review process and now I can see the "Try now" button and the instant app functionality is enabled.

2
On

I faced a similar problem. In my case my app not appeared because of Google Play cache. So, to fix this and be able to acesse my app by my link I cleared the cache with the command:

adb shell am broadcast -a com.google.android.finsky.action.CONTENT_FILTERS_CHANGED
  • You need to run this on a machine with a connected device that you are in an internal test track.

After that my links started to works as expected.

If you have other problems, please let me know, because things related to instant apps not have good documentation and I faced a lot of issues, maybe I can help you too.

0
On

@Bruno Milhan After reading hundreds of posts trying to get data passed to my InstantApp, finding most of them wrestling with changes being made over the years, and not finding much current information, I -- if not many others -- need your offer of help on InstantApps.

Without trying to create a detailed checklist, I can tell you the basics of what I have tried:

The App Links Assistant test maps https://example.com/i/ to package_name.Activity, so the pathPrefix and assetlinks setups are OK. Same for a URL with a parameter like: https://package_name/i/?q=c2ylkt7
I have "dist:instant=true" and "autoVerify=true: in the Manifest and "implementation 'com.google.android.instantapps:instantapps:1.1.0' in build.gradle(app).
I create a configuration (in Giraffe) for an Intent like this: 
    Installation options: Deploy: "APK from app bundle" and "Deploy as instant app" checked
    Launch options: Launch: "URL" and "URL: https://package_name/i/?q=c2ylkt7" (N.B.  "c2ylkt7" is simply a 7-char string to pass to the app.

When I run this with phone cabled to Giraffe the IA code is downloaded and My_app displays perfectly according to the string in the query parameter.

Then I delete the IA, change the build variant to "release" and create a new release in Closed testing. (Yes, I am a Tester). I upload the new app-release bundle and click Next, not "Save as draft", and then "Save". Then I click "Go to overview" to send to Google and start the process. I click "Send 2 changes for review" from previous releases.

Without waiting for Google overview results, I click the URL in an SMS message: https://package_name/i/?q=c2ylkt7 My_app does not appear in Settings>Apps and the URL displays in the browser, not the App output.

Sorry for the length, but I hope that describes the setup and the problem. The bottom line is that two things need to happen:

  1. IA code transfer from Play
  2. Query parameter transfer from the URL to the App

The question is when, why and where is this happening? Why is the release build not transferring the IA code? Is that why the query parameter is not being transferred? Do I have to have an installable version of the IA in the Play release? Is there something that needs to be in "Draft status"? Do we have to wait for Google approval, so at that point this all "just works"?

Is the query parameter handling supposed to allow passing parameters to deep links but not to AppLinks? In other words, what is wrong and/or missing?

You can see how confused at least one developer is. Any light you can shed will be immensely helpful. If you can lay out the path through this maze, it would be unbelievable.