首页 文章

通用深层链接与Mandrill子域

提问于
浏览
3

我的通用深度链接适用于我的iOS应用程序,邻居(与neighbourly.co.nz相关)

我们向用户发送电子邮件,并使用Mandrill跟踪点击次数 . 电子邮件链接转到子域clicks.neighbourly.co.nz/path,指向mandrillapp.com/path,链接重定向到neighbourly.co.nz/newpath

我添加了applinks:clicks.neighbourly.co.nz到应用程序相关域 .

我的apple-app-site-association文件的路径是一个通配符:[“*”]

但是,虽然链接到neighbourly.co.nz正确启动应用程序,链接到Safari.neighbourly.co.nz在Safari中启动 . 我错过了什么?

我在网上找不到有关为深层链接设置子域的任何信息

我的apple-app-site-association文件是否需要在mandrillapp.com上托管?

3 回答

  • 1

    Mandrill的跟踪也可能会弄乱通用链接 .

    我通过禁用mandrill跟踪我的branch.io链接来解决这个问题

    mc:disable-tracking 是关键

    在我的模板中:

    <a href="http://mybranchsubdomomain.mydomain.com/something" mc:disable-tracking>Disabled Mandrill URL</a>
    
  • 3

    我们使用Cloudflare(我推荐使用的一项了不起的服务)在DNS(有点)级别解决了这个问题 .

    使用Cloudflare作为DNS提供商,将Mandrill设置为使用自定义域进行点击跟踪 . 例如,在下面的屏幕截图中,它是在Mandrill和Cloudflare中设置的track.yourdomain.com .

    Mandrill跟踪域名:
    mandrill settings

    Cloudflare DNS:
    cloudflare dns

    然后在Cloudflare中使用他们的"Page Rules"功能创建重定向到您在实际网站上托管的 apple-app-site-association 文件(假设它具有适用于这两个域的规则,否则您可能会重定向到另一个文件,我没有测试这个)

    Cloudflare页面规则:
    cloudflare page rules

    我还添加了一个缓存绕过规则,因为您希望track.yourdomain.com的所有请求都能到达您的源服务器而不会被边缘服务器缓存 .

  • 3

    首先,您不需要在mandrillapp.com上托管 apple-app-site-association 文件 .

    第二件事你需要将 applinks:neighbourly.co.nz 添加到应用程序相关域 .

    因为我刚刚检查过,如果我要求您的服务器 apple-app-site-association 使用URL https://clicks.neighbourly.co.nz/apple-app-site-association,那么您的服务器将返回404文件未找到 .

    然后,我从url https://www.neighbourly.co.nz/apple-app-site-association找到并下载了你的 apple-app-site-association ,我检查了 you are using the old format . 这是您当前的关联文件

    {
      "applinks": {
        "apps": [],
        "details": {
          "2E23KCX8SU.nz.co.neighbourly.ios": {
            "paths":[ "*", "/" ]
          }
        }
      }
    }
    

    用这种新格式替换旧的 apple-app-site-association 文件

    {
      "applinks": {
        "apps": [],
        "details": [
          {
            "appID": "2E23KCX8SU.nz.co.neighbourly.ios",
            "paths":[ "*", "/"  ]
          }
        ]
      }
    }
    

    更新 apple-app-site-association 文件后用Apple Validation Tool测试


    App Search API验证工具结果

    For -> https://clicks.neighbourly.co.nz/apple-app-site-association
    enter image description here


    For -> https://neighbourly.co.nz/apple-app-site-association
    enter image description here

相关问题