【发布时间】:2019-07-09 12:05:28
【问题描述】:
我有以下链接: https://thus.customapp.it/#/app/customapp/itemDetail/45289348293423
我希望这个链接被我的应用程序捕获并打开。所以,我在 AndroidManifest 文件中添加了这些行:
<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:scheme="https" android:host="thus.customapp.it" android:pathPrefix="/#/app/customapp/itemDetail"/>
</intent-filter>
我也试过:
<data android:scheme="https" android:host="thus.customapp.it" android:pathPrefix="/#/app/customapp/itemDetail/.*"/>
还有这个:
<data android:scheme="https" android:host="thus.customapp.it" android:pathPattern="/.*/.*/.*/.*/..*"/>
还有这个:
<data android:scheme="https" android:host="thus.customapp.it" android:android:pathPrefix="/#"/>
还有这个:
<data android:scheme="https" android:host="thus.customapp.it" android:pathPattern="/#/.*" />
但它不起作用。
附:使用以下代码:
<data android:scheme="https" android:host="thus.customapp.it" android:pathPattern="/.*"/>
它有效,但我只需要拦截一个包含“itemDetail”的网址,而不是,例如,https://thus.customapp.it/#/app/customapp/editItem/45289348293423
【问题讨论】:
-
你遇到了什么错误?
-
没有错误,但是如果我点击链接,它将使用 Chrome 而不是应用程序打开
-
您检查过简单链接吗?
-
@GOVINDDIXIT 我编辑了我的问题,也许它可以帮助
-
尝试使用 android:path="/#/app/customapp/editItem/45289348293423" 而不是 android:pathPattern="/.*"
标签: android nativescript android-manifest nativescript-angular