How to configuring deep linking in iOS app

Deep Linking iOS

Author:

Webtonative

24 April, 2024

Share

A Comprehensive Guide to Setting Up Deep Linking in Your iOS App

Deep linking in iOS apps enables users to seamlessly navigate to specific content within your app, enhancing user engagement and providing a cohesive user experience. This user guide provides step-by-step instructions on how to set up deep linking in your iOS app, including the creation of the required apple-app-site-association file.

What is Deep Linking?

Deep linking allows you to use URLs to link directly to specific pages or content within your mobile app. Instead of launching the app's home screen, deep links can take users to specific content, such as a particular product page, user profile, or section within your app.

Step-by-Step Guide to Setting Up Deep Linking

Step 1: Create the AASA File

The apple-app-site-association (AASA) file tells Apple that your app is allowed to handle links from your domain.

Easiest way? Get it via WebToNative’s deep linking tool.

deep linking ios 1.png

Or create it manually using the format below:

AASA File Example { "applinks": { "apps": [], "details": [ { "appID": "TEAMID.com.yourapp.bundleid", "paths": [ "*" ] } ] } }

What to Replace?

✅ TEAMID.com.yourapp.bundleid → Replace: TEAMID with your Apple Developer Team ID (Find it here) com.yourapp.bundleid with your app’s bundle identifier ✅ paths → "*" means all URLs from your domain will open your app. You can specify exact paths if needed.

Step 2: Host the AASA File on Your Server

Now, let’s make it accessible to Apple! ???? Create a .well-known directory at the root of your domain. ???? Place the apple-app-site-association file inside this directory.

Final File Path: https://yourdomain.com/.well-known/apple-app-site-association

How to Store JSON for iOS Deep Linking (AASA File)

Step 1: Create the .well-known Directory

The AASA file must be stored inside a special directory called .well-known at the root of your domain.

What is the Root of Your Domain? If your website is https://example.com, the root directory is where your index.html or server files are located. You need to create a .well-known folder inside this root.

Example of Folder Structure

/var/www/html/ <-- Root directory of your website ├── index.html ├── .well-known/ <-- Create this folder ├── apple-app-site-association <-- Place your file here

Step 2: Upload the AASA File

???? Create your apple-app-site-association file (no .json extension!) ????Upload it to the .well-known folder

Example of Final Path https://example.com/.well-known/apple-app-site-association

1️. Create the .well-known folder in your server ???? If using an FTP client like FileZilla or cPanel, navigate to the root and create a new folder named .well-known.

2️. Upload the apple-app-site-association file ???? Make sure the file has no extension (.json is NOT needed).

Step 3: Verify the Setup

Now that the file is uploaded, let’s test if it’s correctly accessible. ???? Open your browser and visit: https://example.com/.well-known/apple-app-site-association

Conclusion

By following these steps, you can effectively set up deep linking in your iOS app. This will allow users to seamlessly transition from web links to specific content within your app, improving user engagement and providing a more integrated user experience.

For more detailed information, refer to Apple's Universal Links documentation.

Similar Blogs