<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Denner Parreiras</title>
    <description>The latest articles on DEV Community by Denner Parreiras (@denner).</description>
    <link>https://dev.to/denner</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1290221%2F8f00fc49-7f4a-433d-a8ea-1e8b590caccd.jpeg</url>
      <title>DEV Community: Denner Parreiras</title>
      <link>https://dev.to/denner</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/denner"/>
    <language>en</language>
    <item>
      <title>Deep Dive into apple-app-site-association file: Enhancing Deep Linking on iOS</title>
      <dc:creator>Denner Parreiras</dc:creator>
      <pubDate>Wed, 21 Feb 2024 14:58:44 +0000</pubDate>
      <link>https://dev.to/denner/deep-dive-into-apple-app-site-association-file-enhancing-deep-linking-on-ios-4pd1</link>
      <guid>https://dev.to/denner/deep-dive-into-apple-app-site-association-file-enhancing-deep-linking-on-ios-4pd1</guid>
      <description>&lt;p&gt;In the previous article, &lt;a href="https://dev.to/dennerparreiras/understanding-digital-asset-links-file-a-key-to-efficient-and-secure-deep-linking-1kcd"&gt;"Understanding Digital Asset Links File: A Key to Efficient and Secure Deep Linking"&lt;/a&gt;, we explored how Digital Asset Links establish a connection between websites and Android apps for deep linking. Now, let's delve deeper into Apple's equivalent --- the &lt;code&gt;apple-app-site-association&lt;/code&gt; file - and how it significantly enhances deep linking experience on iOS devices.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Inception of &lt;code&gt;apple-app-site-association&lt;/code&gt;
&lt;/h1&gt;

&lt;p&gt;Introduced in iOS 9, Universal Links brought a paradigm shift in handling deep links in iOS. This feature allows URLs to open directly in a corresponding native app, bypassing the Safari browser, providing a seamless user experience. The backbone of Universal Links is the &lt;code&gt;apple-app-site-association&lt;/code&gt; file, which is fundamental in verifying that a link should be opened in an app instead of Safari.&lt;/p&gt;

&lt;h1&gt;
  
  
  Crafting the &lt;code&gt;apple-app-site-association&lt;/code&gt; File: A Step-by-Step Guide
&lt;/h1&gt;

&lt;h1&gt;
  
  
  1. Creating the File
&lt;/h1&gt;

&lt;p&gt;The &lt;code&gt;apple-app-site-association&lt;/code&gt; is a JSON file that needs no signature, unlike its predecessor. This file should be created at the root of your HTTPS web server, ideally placed in the &lt;code&gt;/.well-known/&lt;/code&gt; directory.&lt;/p&gt;

&lt;h1&gt;
  
  
  2. Structuring the File
&lt;/h1&gt;

&lt;p&gt;A typical &lt;code&gt;apple-app-site-association&lt;/code&gt; file looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"applinks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"apps"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"details"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"appID"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"9JA89QQLNQ.com.example.app"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"paths"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/path/to/content"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/path/*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"NOT /path/to/exclude"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;  appID: Your team ID from Apple Developer account combined with your app's bundle ID.&lt;/li&gt;
&lt;li&gt;  paths: Specifies which paths in your website should open the app. It supports simple wildcards and exclusions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  3. Hosting Requirements
&lt;/h1&gt;

&lt;p&gt;Ensure your server supports HTTPS. The &lt;code&gt;apple-app-site-association&lt;/code&gt; file must be accessible via an HTTPS URL and must not redirect to another location.&lt;/p&gt;

&lt;h1&gt;
  
  
  4. Updating Your iOS App
&lt;/h1&gt;

&lt;p&gt;In your Xcode project, enable Associated Domains and add the domain links you wish to associate with your app, prefixed with &lt;code&gt;applinks:&lt;/code&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  How Does This Enhance Deep Linking on iOS?
&lt;/h1&gt;

&lt;p&gt;The &lt;code&gt;apple-app-site-association&lt;/code&gt; file plays a critical role in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Security: By confirming that the domain and app association is verified, it prevents unauthorized apps from intercepting your URLs.&lt;/li&gt;
&lt;li&gt;  User Experience: Universal Links provide a more integrated experience. Users are taken directly to the content in the app, rather than Safari, enhancing usability.&lt;/li&gt;
&lt;li&gt;  Consistency: Universal Links work uniformly across all iOS devices, ensuring a consistent behavior.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;The implementation of &lt;code&gt;apple-app-site-association&lt;/code&gt; for Universal Links in iOS is a significant step towards a more integrated mobile experience. It streamlines the process of opening web content directly in apps, enhancing both security and user experience. As we continue to see evolution in mobile app technologies, tools like these will become increasingly important in bridging the gap between web and mobile applications.&lt;/p&gt;

</description>
      <category>mobile</category>
      <category>ios</category>
      <category>programming</category>
    </item>
    <item>
      <title>Understanding Digital Asset Links File: A Key to Efficient and Secure Deep Linking</title>
      <dc:creator>Denner Parreiras</dc:creator>
      <pubDate>Wed, 21 Feb 2024 14:56:13 +0000</pubDate>
      <link>https://dev.to/denner/understanding-digital-asset-links-file-a-key-to-efficient-and-secure-deep-linking-1kcd</link>
      <guid>https://dev.to/denner/understanding-digital-asset-links-file-a-key-to-efficient-and-secure-deep-linking-1kcd</guid>
      <description>&lt;h3&gt;
  
  
  What is a Digital Asset Links File?
&lt;/h3&gt;

&lt;p&gt;The Digital Asset Links file is an essential tool in the app development world for both Android and iOS, particularly when it comes to implementing deep linking effectively and securely. This JSON file establishes a trust relationship between your website and your app, ensuring that links opened on mobile devices directly lead to the corresponding app, if installed.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Does It Work?
&lt;/h3&gt;

&lt;p&gt;The operation of Digital Asset Links involves a few key steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Hosting the File: The file must be hosted on the domain of the site, typically at the path &lt;code&gt;/.well-known/assetlinks.json&lt;/code&gt;. This allows the mobile device's operating systems to verify whether a particular app is authorized to open links from a specific domain.&lt;/li&gt;
&lt;li&gt;  Automatic Verification: When a link is clicked, the device's operating system checks if there is an installed app with the domain verified in the Digital Asset Links file. If confirmed, the link opens directly in the app; otherwise, it will open in the default browser.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  File Structure
&lt;/h3&gt;

&lt;p&gt;A typical example of the Digital Asset Links file is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"relation"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"delegate_permission/common.handle_all_urls"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"target"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"namespace"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"android_app"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"package_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"com.example.yourapp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"sha256_cert_fingerprints"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"YOUR_SHA_256_CERT_FINGERPRINT"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each field serves a specific purpose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  relation: Defines the type of relationship between the site and the app. It's usually &lt;code&gt;["delegate_permission/common.handle_all_urls"]&lt;/code&gt; for deep linking.&lt;/li&gt;
&lt;li&gt;  target: Specifies the target app with details like &lt;code&gt;package_name&lt;/code&gt; and &lt;code&gt;sha256_cert_fingerprints&lt;/code&gt; for Android.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Android and iOS Versions
&lt;/h3&gt;

&lt;p&gt;For Android, support for App Links was introduced in Android 6.0 (Marshmallow), and it has since become a standard for deep linking implementation.&lt;/p&gt;

&lt;p&gt;On iOS, the equivalent concept is known as Universal Links and was introduced in iOS 9. Instead of using a Digital Asset Links file, iOS uses a file called &lt;code&gt;apple-app-site-association&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solving Deep Linking Problems
&lt;/h3&gt;

&lt;p&gt;The use of the Digital Asset Links file on Android and the &lt;code&gt;apple-app-site-association&lt;/code&gt; file on iOS solves several common deep linking issues:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Improved User Experience: Instead of asking the user whether they want to open a link in the app or browser, the link directly opens in the app if it is installed.&lt;/li&gt;
&lt;li&gt; Enhanced Security: These files ensure that only authorized apps can open links from a specific domain, preventing potential abuses.&lt;/li&gt;
&lt;li&gt; Ease of Implementation: Once set up, the management of deep links becomes much more streamlined and integrated, without the need for additional prompts or choices for the user.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;The Digital Asset Links file in Android and its iOS equivalent are fundamental for effective and secure deep linking implementation in modern apps. By ensuring that links correctly direct to the right apps, they not only enhance user experience but also increase the security and reliability of interactions between websites and mobile applications.&lt;/p&gt;

</description>
      <category>mobile</category>
      <category>android</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
