点击链接询问app / browser的权限,动态使用Ionic deeplinking

时间:2016-10-14 12:31:04

标签: angularjs ionic-framework

大家不会将此问题标记为重复,因为我在过去的72小时内经历了许多链接。帮帮我, 我有网站和应用程序,而注册我发送邮件,他们将从中验证他们的帐户。在网站上运作良好,但是,虽然我厌倦了使用app工作它不会发生在我身上。在mu AndroidManifest.xml文件中,我编写了intent:filter with all preference,plugin,.. but

<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="xyz.com" android:path="/verifyemail/*" android:scheme="http" />
        </intent-filter>

这里xyz是样本。我的问题是, 点击邮件中的验证链接我得到如下链接:

www.xyz.com/verifymail/abc

这里代替abc,它可能是某些其他意味着各种电子邮件ID。如何附加这些并使用离子

请求app / browser

2 个答案:

答案 0 :(得分:1)

在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:host="xyz.com" android:path="/verifyemail/*" android:scheme="http" />
    </intent-filter>

据我所知,我们无法直接获得动态链接,因为必须将路径从abc更改为其他不可能的路径。因此,您必须将其设置为静态并尝试其他流程来实现这些功能,并且您可以根据需求进行遍历。

答案 1 :(得分:0)

如果您正在编写跨平台的Ionic应用,可能需要添加此插件:https://github.com/EddyVerbruggen/Custom-URL-scheme

然后,您可以在AndroidManifest.xml中为您的应用设置匹配方案(比如'myapp'):

<intent-filter>
  <data android:scheme="myapp"/>
  <action android:name="android.intent.action.VIEW" />
  <category android:name="android.intent.category.DEFAULT" />
  <category android:name="android.intent.category.BROWSABLE" />
</intent-filter>

网址myapp://www.xyz.com/verifymail/abc将会打开您的应用。希望这有帮助吗?