What setting of web.config will allow serving apple-app-site-association?

I added the apple-app-site-association file to the root of the website, but IIS does not deliver the file.

What is the best way to get a server to serve this particular file without a file extension? Is there a way in web.config to explicitly indicate "serve this file"?

+5
source share
2 answers

I had the same problem and found this awesome post :

Serving Apple-app-site-association from IIS IIS supports only known file types defined by their extension. Since apple-app-site-association does not include the file extension, IIS throws a 404 error when I try to open it using a browser. I fixed this by adding mimeMap to the web.config file:

 <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <staticContent> <!-- required for apple-app-site-association: --> <mimeMap fileExtension="." mimeType="application/json" /> </staticContent> </system.webServer> </configuration> 
+9
source

Not my preferred solution, but in a DeyaEldeen comment, the way I met a lot of our needs was to use the meta tag instead (in the <head> page):

 <meta name="apple-itunes-app" content="app-id=5555555555"> 

This means that whenever iOS users browse the site, they appear at the top of the page as "view in the app store." As soon as they click on the popup, they get to the app store.

See Apple Docs for Smart Banners .

Hope this helps some people with similar needs.

+1
source

Source: https://habr.com/ru/post/1262753/


All Articles