问题描述
我正在尝试通过导航到已在Android Studio中测试并部署到应用商店的关联链接来从URL打开即时应用。我已经测试了以下内容:
- 我知道即时应用程序可用,因为Google Play页面上有“ Try It”,可以有效地工作。
- App Links Assistant进程已完全配置,直至“测试App Links”可打开IA并正常工作。
- assetlinks.json放在我的服务器上,可以由https://example.com/.well-known/assetlinks.json 访问
- 激活了以下URL中的设置:https://support.google.com/googleplay/answer/7240211?hl=en
意图过滤器也按照说明进行了完全配置:
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.broWSABLE" />
<data
android:scheme="http"
android:host="example.app" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.broWSABLE" />
<data
android:scheme="http"
android:host="example.app" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.broWSABLE" />
<data
android:scheme="https"
android:host="example.app" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.broWSABLE" />
<data
android:scheme="https"
android:host="example.app" />
</intent-filter>
但是,当我导航到URL时,它没有按预期重定向到我的即时应用程序。有人可以引导我指出可能出问题的地方吗?
解决方法
我想出了答案。如果我直接在浏览器上输入URL,它将不会打开即时应用程序,而是打开相应的网站。但是,如果我单击另一个网站的链接中的URL或文本消息,它将按预期方式打开即时应用程序。奇怪的是,我试图从NFC标签启动,该标签被视为浏览器中输入的URL。
,@Jacobo我在另一篇文章中看到有人提到Firebase Dynamic Link,即使是针对浏览器,它们也已修复。我尚未进行测试,因为我实际上是在尝试修复一个步骤。如果我没有缓存或安装即时应用程序,那么我的链接将转到网站,而不是InstantApp。一旦我手动打开Instant或安装完整版本,就可以正常工作,但是未缓存/未安装的版本无法正常工作。在Google Play上,我已经看到“立即尝试”按钮。