【发布时间】:2018-12-12 15:43:21
【问题描述】:
我想通过电子邮件中的链接在 Application Android (Nativescript) 中打开我的组件,即单击此处重置密码
我在电子邮件中有这样的链接:
http://secsystem.domain.tk/v1/resetPassword/11E8FC9
因此,当我从移动浏览器单击链接时,我需要在组件 resetPassword 中启动应用程序。
我使用以下代码:
AndroidManifest.xml
<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="http" android:host="secsystem.domain.tk" android:path="/v1/resetPassword"></data>
</intent-filter>
此代码仅在此 url 中有效:http://secsystem.domain.tk/v1/resetPassword
我想在这个网址工作:http://secsystem.domain.tk/v1/resetPassword/11E8FC9
在 routing.ts 我写了这段代码:
{ path: 'v1/resetPassword/:id', component: ResetPassIdComponent },
我想在点击链接时打开这个组件。
有什么解决办法吗?
【问题讨论】:
-
如果你想通过额外的参数保持路径动态,请使用android:pathPattern。
-
你能写代码吗?
-
应该是
android:pathPattern="/v1/resetPassword/.*" -
我像你说的那样尝试,效果很好。但不会在这条路径上溃败
v1/resetPassword/:id,组件ResetPassIdComponent请问您有什么想法吗?
标签: android angular typescript nativescript