【发布时间】:2017-11-10 07:46:49
【问题描述】:
我创建了一个即时应用程序,并为其创建了应用程序链接。
我在有效网站上托管了assetlinks.json。
我的网站名称如下:
https://instantappsbase.firebaseapp.com assetlinks.json 通过生成的调试版本数字签名托管在上述网站上:
https://instantappsbase.firebaseapp.com/.well-known/assetlinks.json
我添加了一个功能,它启动一个带有消息 "Hello World" 的活动。
我尝试按照“URL-mapping editor”中的配置如下调用该活动:
https://instantappsbase.firebaseapp.com/hi
我在我的手机和模拟器的浏览器中尝试了上面的 URL,它不起作用。
当我尝试通过以下意图调用时:
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);
一切正常。
但是当我尝试通过浏览器打开它时,它不起作用。它显示“PageNotfound”错误。
有没有一种方法可以让我们在不通过 Google Play 商店上传我们安装的应用程序和即时应用程序的情况下完成这项工作。
还是我错过了这个流程中的一些东西。?
谁能帮我解决这个问题?
提前致谢。
【问题讨论】:
-
相同的 url 应该首先适用于 Applink/Deeplink。如果应用程序未启动,请尝试在手机上安装应用程序时点击该 URL,这意味着 AppLink 配置不正确。
-
当我尝试通过以下意图调用时: Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("instantappsbase.firebaseapp.com/hi")); intent.setPackage(getPackageName()); intent. addCategory(Intent.CATEGORY_BROWSABLE); startActivity(intent); 。它工作正常。
但是当我尝试通过浏览器打开它时它不起作用。它显示“PageNotfound”错误 -
除了philo的发布要求之外,“但是当我尝试通过浏览器打开它时它不起作用。”是什么意思?您是否希望 AIA 通过在地址栏中键入该 URL 来显示?它不是那样工作的。必须通过链接解决。尝试将您的 AIA 链接粘贴到环聊或 Google 文档,然后从那里点击。
标签: android deep-linking applinks android-instant-apps