在一个项目中,我遇到了一个非常奇怪的问题:
深度链接在过去一年里一直表现得非常好,但最近(自2019年1月初以来),我们收到了用户反馈,称深度链接已经停止工作(有人说10次中有9次失败)。
我们没有更改任何代码,并且很难复制这个问题。
更奇怪的是,在我们自己遇到这个问题的稀少时刻,Android操作系统甚至不会通过“打开方式”对话框显示我们的应用程序选项。这使我们认为,该操作系统有时会忘记应用程序在其清单中注册的意图过滤器。
重新启动应用程序似乎可以解决这个问题,并且深层链接再次开始工作。 当我们从Android Studio进行新的构建时,应用程序也似乎每次都正常工作,这使问题很难复制。
我们的清单有一个专门处理深度链接的活动:
<activity
android:name="com.company.DeepLinkActivity"
android:noHistory="true"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="ideal-payment"
android:scheme="com.company.ideal" />
<data
android:host="ideal-payment"
android:scheme="com-company-ideal" />
</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:host="${appLinkIdealHost}"
android:pathPrefix="/ideal-betaling/landingpage"
android:scheme="https" />
</intent-filter>
<intent-filter android:autoVerify="true">
...
</intent-filter>
<intent-filter android:autoVerify="true">
...
</intent-filter>
</activity>
我们认为这可能与autoVerify无法访问有关,但当问题出现时,操作系统应该显示'打开方式'对话框,但实际上并没有。
是否有人遇到过类似的问题?非常感谢任何帮助或建议。