apple-app-site-association JSON not showing up?

568 Views Asked by At

I have implemented my association like it is done here, but when I then go to check the JSON by doing: https://day21.co/apple-app-site-association.

​ This shows up:

{"applinks":{"apps":[],"details":[]}}

Rather than what I have in the file: ​

    {
    "applinks": {
        "apps": [],
        "details": [
        {
            "appID": "BID.com.Name.SignUpFlowclub"
            "paths": ["*"]
        }
        ]
    }
}

Here you can see the placement of the file, which I firebase deployed to hosting successfully. https://i.stack.imgur.com/tX5K2.png

What am I doing wrong?

1

There are 1 best solutions below

3
On

you trying to read .txt file.

just change that extension to .json and read again.

And read json like below.

func readJson() {
        let jsonUrl = Bundle.main.url(forResource: "apple-app-site-association", withExtension: "json")!
        do {
            let data = try Data(contentsOf: jsonUrl, options: .mappedIfSafe)
            let jsonResult = try JSONSerialization.jsonObject(with: data, options: .mutableLeaves)
            let result = jsonResult as! [String : Any]
        } catch let error {
            print(error)
        }
    }