带有路径模式的Android意图过滤器在助手中匹配,但不起作用



我正在尝试创建一个应用程序链接来打开我们的应用程序而不是浏览器。

应用程序链接助手告诉我该模式工作正常,但是当我在模拟器或物理设备上尝试它时,它不起作用:(

滤波器:

<activity android:name=".activities.AppLinksActivity">
<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="www.emagister.com"
android:pathPattern="/.*-cursos-.*.htm"
/>
</intent-filter>
</activity>

要匹配的网址:http://www.emagister.com/curso-avanzado-lenguaje-programacion-javascript-cursos-2863146.htm

助理消息:

助理图片

图片但是当我在设备上打开它或单击运行测试时,我不起作用并打开浏览器。

如果我在清单中输入android:pathPattern="/juridico-master-compliance-officer-controller-juridico-empresarial-cursos-3299291.htm",而不是上面的路径模式,一切都很完美。

我做错了什么?

提前感谢!!

您的pathPattern正则表达式似乎不必要地复杂;我不相信它记录了这里使用哪个正则表达式解析器,但如果它以某种方式窒息了,我不会感到惊讶。

尝试尽可能简化,然后重新添加元素(但尽可能少(。我怀疑pathPattern='.*cursos.*'仍然会让你得到同样的东西。

最新更新