Creating Connected App Experiences with App Links
Mobile apps are silos! We create apps with amazing experiences, but they are self contained with no idea how to communicate with any other app. Let’s say I share a link to a new song on Rdio over Facebook, tapping that link in most apps will probably bring you to the web browser resulting in a poor user experience that takes you outside of the app. If you already have the Rdio app installed, wouldn’t it be more useful if tapping the link in Facebook opened the song directly in the Rdio app and started playing?
Enter App Links
The good news is that there is a solution to this problem with App Links. App Links aims to solve this common issue by allowing any web page to describe how to deep-link to content within mobile apps on various platforms.
It’s already possible to pass information between mobile apps, but it’s difficult to discover what format that information should be in. App Links is ready to become the standard discovery mechanism for navigating between apps and already has the support of Facebook, Rdio, and Vimeo, just to name a few.
A New Way to Navigate
The secret is in changing the way every mobile app handles navigation, and it’s not very difficult to do. For example, if you have an iOS app and are navigating to a web page your code probably looks something like this:
To enable App Links for this page all you need to do is simply update this single line of code:
Now, let’s see what this is actually doing under the hood when you click on the link and navigate with App Links.
How does it work?
Instead of immediately displaying a browser when navigating to a URL, your app first asks the web server for the <meta .. /> tags of the URL. This is where the web page has an opportunity to describe how the content on the page can be deep-linked to within a mobile app.
All the web page owner needs to do is add some metadata content to their page. A page for a song on Rdio might have metadata like this:
<meta property="al:ios:url" content="rdio://song/12345" />
<meta property="al:android:url" content="rdio//song/12345" />
<meta property="al:windows_phone" content="rdio/song/12345" />
This would describe to any mobile app attempting to navigate to the web page URL http://rdio.com/song/12345 which app URL to use for the various platforms Rdio runs on iOS, Android, and Windows Phone.
App Links for iOS, Android, and Windows Phone
If you’ve seen the Official App Links Documentation, you may have seen that they’ve already released Objective-C and Java libraries, called Bolts, to help developers implement App Links in their own apps.
Continuing with our mantra at Xamarin to “delight developers”, we’re already delivering on this huge opportunity of supporting App Links in Xamarin apps. Today, we are announcing our own Open-Source C# App Links implementation called Rivets, which supports Xamarin.iOS, Xamarin.Android, and Windows Phone.
Rivets is available as a Xamarin Component on our Component Store so you can easily integrate it into your Xamarin projects.
If you want to take a deeper dive into what App Links are, and how to integrate them into your apps, check out my blog post: What are App Links?. You can also learn more on the official App Links site.