I am new on iOS development. I am implementing Universal Links in iOS App with ASP.net application.
I have define my associate domain in capabilities under Associated Domains:
applinks:www.abcd.com
And also configure in App Ids on Apple Developer Account. I think app side work is all set .
But I think problem with apple-app-site-association file.
I have written json in a simple text file like below
{
"applinks": {
"apps": [],
"details": [
{
"appID": "8T8932TY.com.AppName”,
"paths": ["*"]
}
]
}
}
Now I am stuck here. My application targeting on iOS 9 and above. I am confused that what is the extension of this file with naming apple-app-site-association. If I need to signed in with new certificates or not. And how upload it on server side.
Please guys help me out. I am searching lot for this but not get satisfactory answer.
Thanks
Your example JSON looks fine if substituted with real values for the AppID/AppName. You may want to be specific about what routes you handle but that's up to you - it's a better user experience to only try to handle routes that there's some chance you'll be able to handle, rather than opening your app for every link on your domain and kicking the user out to Safari again if that turns out not to be true.
The apple-app-site-association
file should not have any file extension, and should be served from the root of your site, https://example.com/apple-app-site-association
, and/or from https://example.com/.well-known/apple-app-site-association
.
You say you're supporting iOS 9 and above - the change to check the .well-known route, which is checked first, came in iOS 9.3, so if you want to support below that OS, you're best off putting the file in both locations. See this answer for details.
It's also important that the file is served with the correct MIME-type, for Universal Links it can be served as application/json
, and there's no need to sign/encrypt it. Getting it served with the correct MIME-type can be a little annoying if you're not familiar with configuration on your web server, as typically servers will determine the MIME-type from the file extension. You can't give it an extension, as iOS won't check the url with an extension and (IIRC) redirects are not allowed so you can't fake it by doing that either.
So that's a summary of what you're trying to accomplish, but how you do that depends on the web server you're using. For an ASP app that's likely to be IIS, in which case this question and its answers may help you configure your web server correctly. The details of how you upload a file to the root of that server will very much depend on how you've configured it as well.