-
-
Save mbleigh/c9140c97a342b9d2e7cd727e21b6268f to your computer and use it in GitHub Desktop.
{ | |
"hosting": { | |
"headers": [ | |
{ | |
"source": "/.well-known/apple-app-site-association", | |
"headers": [{"key": "Content-Type", "value": "application/json"}] | |
} | |
] | |
} | |
} |
Ok, so this is what I did to make it work
- Deleted the
apple-app-site-association
file - Recreated it via terminal with the following command
touch apple-app-site-association
(note, there is no.json
) - Moved the
apple-app-site-association
to the public folder at the root + also added the well known folder toopublic/.well-known/apple-app-site-association
I then verified with https://branch.io/resources/aasa-validator/
I also then went to https://_my_redacted_app+name/.well-known/apple-app-site-association and saw the expected JSON from apple-app-site-association
The code looks like this
Firebase.json
file
{
"hosting": {
"public": "public",
"headers": [
{
"source": "/.well-known/apple-app-site-association",
"headers": [
{
"key": "Content-Type",
"value": "application/json"
}
]
},
{
"source": "apple-app-site-association",
"headers": [
{
"key": "Content-Type",
"value": "application/json"
}
]
}
],
"appAssociation": "NONE"
}
}
apple-app-site-association
{
"applinks": {
"details": [
{
"appIDs": [ ""_my_redacted_app_id.my_redacted_bundle_id""],
"components": [
{
"/": "/public/*",
"comment": "my_redacted_comment"
}
]
}
]
}
}
"source": "/.well-known/apple-app-site-association", "headers": [ { "key": "Content-Type", "value": "application/json" } ]
putting it in public/.well-known solved it for me. Note, I also didn't need to include the appAssociation line in firebase.json, seems they fixed that bug.
In the Branch.io aasa validator, I'm getting a successful response.
But when I try hitting the URL in the app, it is not opening the app.
I hosted the website in the default domain
then I created another domain
I use the other domain to handle my deep link which works fine on Android but ios, not
ios open the preview screen then redirect to the hosted website (default domain) expected to open ios app like android
firebase.json
{
"hosting": {
"public": "build/web",
"ignore": [
"firebase.json",
"/.*",
"/node_modules/"
],
"headers": [
{
"source": "/.well-known/apple-app-site-association",
"headers": [
{
"key": "Content-Type",
"value": "application/json"
}
]
},
{
"source": "apple-app-site-association",
"headers": [
{
"key": "Content-Type",
"value": "application/json"
}
]
}
],
"appAssociation": "NONE",
"rewrites": [
{
"source": "",
"dynamicLinks": true
},
{
"source": "/",
"dynamicLinks": true
},
{
"source": "/links/",
"dynamicLinks": true
},
{
"source": "/sina-app.com/",
"dynamicLinks": true
},
{
"source": "https://sina-app.com/",
"dynamicLinks": true
},
{
"source": "sina-app.com/**",
"dynamicLinks": true
},
{
"source": "sina-app.com/*",
"dynamicLinks": true
}
]
}
}
SOLVED my folder was .well_known instead of .well-known
I don't know why I am getting content-type: text/plain; charset=utf-8
when curl -i https://destrompesetvous-b6900.web.app/.well_known/apple-app-site-association
I also placed apple-app-site-association inside root and here it is working, I am getting content-type: application/json
when curl -i https://destrompesetvous-b6900.web.app/apple-app-site-association
firebase.json
{
"hosting": {
"public": "build/web",
"headers": [
{
"source": "/.well-known/apple-app-site-association",
"headers": [
{
"key": "Content-Type",
"value": "application/json"
}
]
},
{
"source": "/apple-app-site-association",
"headers": [
{
"key": "Content-Type",
"value": "application/json"
}
]
},
{
"source": "/.well-known/assetlinks.json",
"headers": [
{
"key": "Content-Type",
"value": "application/json"
}
]
}
],
"appAssociation": "NONE"
}
}
apple-app-site-association and .well_known/apple-app-site-association
{
"webcredentials":{
"apps":[
"JJS627SP9W.fr.trompe.appli"
]
},
"applinks":{
"details":[
{
"appID":"JJS627SP9W.fr.trompe.appli",
"paths":[
"*"
],
"appIDs":[
"JJS627SP9W.fr.trompe.appli"
],
"components":[
{
"/":"/*"
}
]
}
]
}
}
And tried adding rewrites rules without success
"rewrites": [ {
"source": "/.well-known/apple-app-site-association",
"destination": "/apple-app-site-association"
} ],
This saved my time. I was chasing this for 2 days and this saved my time.