Search code examples
iosxcodedeep-linkingflutter-deep-link

Deeplinking not working for IOS app (Flutter)


I try to activate deeplinking for my iOS app, but I have issues to do so.

As said in the official IOS tutorial :

1) I uploaded on my own website the following content :

{
  "applinks": {
      "apps": [],
      "details": [
      {
        "appID": "xxx.com.myapp.app",
        "paths": ["*"]
      }
    ]
  }
  
}

I uploaded this on a link : https://myapp.web.app/apple-app-site-association

2) I filled XCode with the following informations [See what i did on xcode]

However, when i click on a link who's supposed to open my app, this is not working... Do you see something I did wrong or I could have missed?

Thank you for your help on this


Solution

  • You need to make sure that the file type is served as JSON by your server. In Nginx you can do it by adding the following block to your server configuration

    location ~* ^/(\.well-known/)?apple-app-site-association {
        default_type 'application/json';
    }
    

    You can also do this in Firebase with a firebase.json file containing :

    {
      "hosting": {
        "headers": [
          {
            "source": "/.well-known/apple-app-site-association",
            "headers": [{"key": "Content-Type", "value": "application/json"}]
          }
        ]
      }
    }