1

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?

Kev Wats
  • 896
  • 1
  • 5
  • 13

1 Answers1

0

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)
        }
    }
jatin fl
  • 157
  • 6
  • 1
    well when your using Apple-app-site-association it appears your not supposed to use ANY EXTENSION... json or txt... I'm assuming the computer automatically marks it as txt by default but is not actually txt as it has no extension (the file) – Kev Wats Apr 03 '21 at 06:19
  • okay. can show me your code where you generate `apple-app-site-association` so i might help you. – jatin fl Apr 03 '21 at 08:18
  • yes, i believe it is in my question... i generated the apple-app-site-association by doing $ touch apple-app-site-association in the teriamnal – Kev Wats Apr 03 '21 at 22:29