Universal Deep Links with Mandrill sub domain

微笑、不失礼 提交于 2019-12-10 18:45:15

问题


I have Universal Deep Links working for my iOS app, Neighbourly (associated with neighbourly.co.nz)

We send out emails to our users and use Mandrill to track clicks. The email links go to a subdomain clicks.neighbourly.co.nz/path which points to mandrillapp.com/path and the links redirect to neighbourly.co.nz/newpath

Ive added applinks:clicks.neighbourly.co.nz to the apps associated domains.

My apple-app-site-association file's paths is a wildcard: ["*"]

But, while links to neighbourly.co.nz launch the app correctly, links to clicks.neighbourly.co.nz launch in Safari. What am I missing?

I can't find any info online about setting up subdomains for deep links

Does my apple-app-site-association file need to be hosted at mandrillapp.com?


回答1:


Mandrill's tracking may also be messing with the universal link.

I got around this by disabling mandrill tracking for my branch.io links

mc:disable-tracking is the key

In my template:

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



回答2:


We solved this at the DNS (kinda) level using Cloudflare (an amazing service I'd recommend using anyway).

Set up Mandrill to use a custom domain for click tracking using Cloudflare as the DNS provider. In the screenshots below for example it is track.yourdomain.com set up in Mandrill and Cloudflare.

Mandrill tracking domain:

Cloudflare DNS:

Then in Cloudflare use their "Page Rules" feature to create a redirect to the apple-app-site-association file you have hosted on your actual website (assuming it has the rules that will work on both domains, otherwise you can probably redirect to another file, I didn't test this)

Cloudflare page rules:

I also added a cache bypass rule because you want all requests to the track.yourdomain.com to reach your origin server and not get cached by an edge server.




回答3:


First of all you don't need to host apple-app-site-association file at mandrillapp.com.

Second thing you need to add applinks:neighbourly.co.nz to the apps associated domains.

Because I just checked, if I'm requesting to your server for apple-app-site-association with URL https://clicks.neighbourly.co.nz/apple-app-site-association then your server return 404 file not found.

Then, I found and downloaded your apple-app-site-association from url https://www.neighbourly.co.nz/apple-app-site-association and I checked you are using the old format. Here your current association file

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

replace your old apple-app-site-association file with this new format

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

After update apple-app-site-association file test it with Apple Validation Tool


App Search API Validation Tool Result

For -> https://clicks.neighbourly.co.nz/apple-app-site-association


For -> https://neighbourly.co.nz/apple-app-site-association



来源:https://stackoverflow.com/questions/33882647/universal-deep-links-with-mandrill-sub-domain

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!