iosswiftdeep-linkingios-universal-links

What is the simplest way to serve apple-app-site-association file locally for testing


I am working on implementing universal links in an iOS app. As per the requirement to implement this I have to serve an apple-app-site-association file from our server end to ensure this is our website.

My concern is that we will serve this file from our real server of course but is there any quicker way to mock this process locally or remotely so that I can bypass the testing phase at the time of implementation? As you know interrupting the other team for some small changes or trial and error seems boring.


Solution

  • It is recommended to have a staging server before you move/deploy you changes in the production. In cases of small projects this could be you local machine. In order for universal links to work you need two things:

    1. The server that hosts the apple-app-site-association needs to have a valid ssl certificate. It will refuse to get the file from a http:// connection or from a https:// with an invalid (e.g. self signed) certificate, unless it is trusted by the device. To make a self signed certificate trusted check here.
    2. The server that hosts the apple-app-site-association needs to publicly accessible because the file is delivered thru CDN, if not when you need to modify the entitlement file to add ?mode=developer, like this: applinks:ourDevServerURL?mode=developer