May 15, 2014

Creating Connected App Experiences with App Links

By

AppLinks-Linking-To-Other-AppsMobile 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.

App Link Example - Rdio

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:

UIApplication.SharedApplication.OpenUrl(“http://rdio.com/song/12345″);

To enable App Links for this page all you need to do is simply update this single line of code:

AppLinks.Navigator.Navigate(“http://rdio.com/song/12345″);

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:

<head>
 <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" />
</head>

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

Rivets-NuGet-IconIf 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.

Learn More

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.

Update: Check out our recipes for adding App Links to your Xamarin.iOS and Xamarin.Android apps!

Discuss this blog post in the Xamarin Forums

TwitterFacebookGoogle+LinkedInEmail