简体   繁体   English

使用应用链接启动免安装应用

[英]Use app links to launch instant apps

I created a instant app for which I created app links.我创建了一个即时应用程序,并为其创建了应用程序链接。 I hosted assetlinks.json over valid website.我在有效网站上托管了assetlinks.json
My website name is as below:我的网站名称如下:
https://instantappsbase.firebaseapp.com https://instantappsbase.firebaseapp.com
assetlinks.json is hosted over the above website through generated digital signature of debug version: assetlinks.json通过生成调试版本的数字签名托管在上述网站上:
https://instantappsbase.firebaseapp.com/.well-known/assetlinks.json https://instantappsbase.firebaseapp.com/.well-known/assetlinks.json
I added a feature which launches an activity with a message " Hello World " .我添加了一个功能,它启动一个带有“ Hello World ”消息的活动。
I tried to call that Activity as below as configured in " URL-mapping editor ": https://instantappsbase.firebaseapp.com/hi我尝试按照“ URL-mapping editor ”中的配置调用该活动,如下所示: https : //instantappsbase.firebaseapp.com/hi
I tried the above URL in browser of my mobile and emulator , its not working.我在我的手机和模拟器的浏览器中尝试了上面的 URL,它不起作用。
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 .它显示“ PageNotfound错误
Is there a way in which can we get this working without uploading our installed app and instant app over google play store.有没有一种方法可以让我们在不通过 Google Play 商店上传我们已安装的应用程序和即时应用程序的情况下使其工作。
or did I miss some thing in this flow.?或者我错过了这个流程中的一些东西。? Can anyone help me regarding this issue?任何人都可以帮助我解决这个问题吗?

Thanks in Advance.提前致谢。

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.当您在浏览器的地址栏中键入 URL 时,浏览器将处理打开内容。

What you can do to launch your instant app:您可以采取哪些措施来启动免安装应用:

  • Open the link from within another app that is not consuming the intent itself (eg 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.只有当免安装应用部署到 Play 商店或者您在本地部署了免安装应用的某个版本时,这两种方式中的任何一种才有效。

该应用程序必须在 Play 商店中发布。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM