What is the procedure to upload apple-app-site-association file in server. stg1.example.com is website where universal linking need to be done and file should be uploaded in the root path of it.How to make the service to upload for universal linking in iOS . How to upload the json formatted file in the server ?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
- Attempt to present UIAlertController on View Contr
The
apple-app-site-association
file needs to be accessible viaHTTPS
, without any redirects, at https://stg1.example.com/apple-app-site-association.The file looks like this:
demo file in example
NOTE - Don’t append
.json
to theapple-app-site-association
filename.The keys are as follows:
apps
: Should have an empty array as its value, and it must be present. This is how Apple wants it.details
: Is an array of dictionaries, one for each iOS app supported by the website. Each dictionary contains information about the app, the team and bundle IDs.There are 3 ways to define paths:
Static
: The entire supported path is hardcoded to identify a specific link, e.g. /static/termsWildcards
: A * can be used to match dynamic paths, e.g. /books/* can matches the path to any author’s page. ? inside specific path components, e.g. books/1? can be used to match any books whose ID starts with 1.Exclusions
: Prepending a path with NOT excludes that path from being matched.The order in which the paths are mentioned in the array is important. Earlier indices have higher priority. Once a path matches, the evaluation stops, and other paths ignored. Each path is case-sensitive.
Supporting Multiple Domains
Each domain supported in the app needs to make available its own apple-app-site-association file. If the content served by each domain is different, then the contents of the file will also change to support the respective paths. Otherwise, the same file can be used, but it needs to be accessible at every supported domain.
Validate your Server with Apple App search validation tool
Test your webpage for iOS 9 Search APIs. Enter a URL and Applebot will crawl your webpage and show how you can optimize for best results https://search.developer.apple.com/appsearch-validation-tool/
Website Code
The website code can be found gh-pages branch on https://github.com/vineetchoudhary/iOS-Universal-Links/tree/gh-pages
Signing the App-Site-Association File (For not
HTTPS
server's)Note: You can skip this part if your server uses
HTTPS
to serve content and jump to Application Setup guide.If your app targets iOS 9 and your server uses
HTTPS
to serve content, you don’t need to sign the file. If not (e.g. when supporting Handoff on iOS 8), it has to be signed using aSSL
certificate from a recognized certificate authority.Note: This is not the certificate provided by Apple to submit your app to the App Store. It should be provided by a third-party, and it’s recommended to use the same certificate you use for your
HTTPS
server (although it’s not required).To sign the file, first create and save a simple .txt version of it. Next, in the terminal, run the following command:
This will output the signed file in the current directory. The
example.com.key
,example.com.pem
, andintermediate.pem
are the files that would made available to you by your Certifying Authority.Note: If the file is unsigned, it should have a
Content-Type
ofapplication/json
. Otherwise, it should beapplication/pkcs7-mime
.Check out my full detailed answer here
How to support Universal Links in iOS App and setup server for it?