1

I created a instant app for which I created app links. I hosted assetlinks.json over valid website.
My website name is as below:
https://instantappsbase.firebaseapp.com
assetlinks.json is hosted over the above website through generated digital signature of debug version:
https://instantappsbase.firebaseapp.com/.well-known/assetlinks.json
I added a feature which launches an activity with a message "Hello World" .
I tried to call that Activity as below as configured in "URL-mapping editor": https://instantappsbase.firebaseapp.com/hi
I tried the above URL in browser of my mobile and emulator , its not working.
When I try to call through intent as below:

      Intent intent = new Intent(Intent.ACTION_VIEW,
            Uri.parse("https://instantappsbase.firebaseapp.com/hi"));<br>
    intent.setPackage(getPackageName());
    intent.addCategory(Intent.CATEGORY_BROWSABLE);
    startActivity(intent); 


It's working fine.
But when I try to open it through browser its not working. It displays "PageNotfound" error.
Is there a way in which can we get this working without uploading our installed app and instant app over google play store.
or did I miss some thing in this flow.? Can anyone help me regarding this issue?

Thanks in Advance.

Prags
  • 2,457
  • 2
  • 21
  • 38
  • The same url should work for Applink/Deeplink first. Try hitting that URL while app is installed on your phone if app doesn't start it means AppLink is not configured properly. – adnanyousafch Nov 10 '17 at 08:56
  • When I try to call through intent as below: Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://instantappsbase.firebaseapp.com/hi")); intent.setPackage(getPackageName()); intent.addCategory(Intent.CATEGORY_BROWSABLE); startActivity(intent); . Its working fine.
    But when I try to open it through browser its not working. It displays "PageNotfound" error
    – Android_programmer_office Nov 10 '17 at 10:12
  • 1
    Besides philo's publishing requirement, what do you mean by "But when I try to open it through browser its not working."? Are you expecting AIA to show by typing that URL into the address bar? It does not work that way. It must be resolved through a link. Try pasting your AIA link to Hangouts or Google docs and click it from there. – TWL Nov 13 '17 at 19:21

2 Answers2

3

But when I try to open it through browser its not working.

When you type the URL in the browser's address bar, the browser will handle opening the content.

What you can do to launch your instant app:

  • Open the link from within another app that is not consuming the intent itself (e.g. Chat, Keep)
  • launch it via the command line like this:

    adb shell am start -a android.intent.action.VIEW \ -d "https://instantappsbase.firebaseapp.com/hi"

Note:

Either of these ways only work if the instant app is deployed to the Play Store or you have a version of the instant app deployed to your device locally.

Ben Weiss
  • 17,182
  • 6
  • 67
  • 87
  • 2
    with "you have a version of the instant app deployed to your device locally" you mean for example launching the instant app through Android Studio? Because I got confused by your sentence, there isn't a way of having instant apps "locally", right? That's the whole point – Emilian Cebuc Feb 03 '19 at 04:10
1

The app must be published in the Play Store.

philo
  • 3,580
  • 3
  • 29
  • 40