Deep Linking

Deep links enable mobile apps to open and directly link into specific areas or content within another mobile application.

For example, Yelp could deep link into Google Maps to display directions to Philz Coffee with the following link:

comgooglemaps://?daddr=201+Berry+St,+San+Francisco,+CA

Implementation

iOS

if([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"comgooglemaps://"]]) {
	[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"comgooglemaps://?daddr=SFO&directionsmode=driving"]];
}
The above opens Google Maps with driving directions to SFO Airport.

Android

Option 1: Check if Intent can be handled
Uri imdbUrl = Uri.parse("imdb:///name/nm0000158/");
Intent imdbIntent = new Intent(Intent.ACTION_VIEW, imdbUrl);

PackageManager packageManager = getPackageManager();
List<ResolveInfo> activities = packageManager.queryIntentActivities(imdbIntent, 0);
boolean isIntentSafe = activities.size() > 0;

if (isIntentSafe) {
    startActivity(imdbIntent);
}
The above link opens IMDB to Tom Hanks Profile.
Option 2: Check if App is installed
PackageManager packageManager = getPackageManager();
try {
	packageManager.getPackageInfo("com.imdb.mobile", PackageManager.GET_ACTIVITIES);
	
	Uri imdbUrl = Uri.parse("imdb:///name/nm0000158/");
	Intent imdbIntent = new Intent(Intent.ACTION_VIEW, imdbUrl);
	startActivity(imdbIntent);
}
catch(PackageManager.NameNotFoundException e) {
	
}
The above link opens IMDB to Tom Hanks Profile.