deeplinking 101 - naor rosenberg, quixey
TRANSCRIPT
DroidCon
Agenda
• What are deep links?
• Why are deep links useful for developers? For users?
• How do I implement deep linking?
DroidCon
airbnb://rooms/5259603 etsy://listing/190881511 ebay://link/?nav=item.view&id=161640221974&referrer=ebay.com&min_version=17 android-‐app://com.airbnb.android/airbnb/rooms/5259603 and even: http://sub.domain.com/path?param=value
Deep Links – Real World Examples
http://example.com/over/there?param=value scheme domain path query
DroidCon
Agenda
• What are deep links?
• Why are deep links useful for developers? For users?
• How do I implement deep linking?
DroidCon
"Deep links to your app appear in Google Search results on Android so users can get to your native mobile experience quickly and easily."
Source: Google Developer's Website
Why: Growth & Engagement
DroidCon
Growth & Monetization: Cross-promotion of app functions will create the
highway of the future mobile ecosystem
DroidCon
Solution: Connect a Grid System of Apps
*Source: Happy family iz happy by Frédéric de Villamil / CC BY-SA 2.0
DroidCon
Agenda
• What are deep links?
• Why are deep links useful for developers? For users?
• How do I implement deep linking?
DroidCon
How: Strategies
Defining • Manifest.xml: add
intent-filter • Handle intents in
the Activity
Publishing • Web to Native
Mappings • Stand-alone Native
DroidCon
How: Defining Deep Links
• Android
• Define intent filters in the app manifest
• Should have at least one intent filter per deeplinkable activity
• The intent filter should have a data tag with at least the android:scheme attribute set
• Handling the intent in the activity
DroidCon
Example: Defining Deep Links – Intent Filters
<!-‐-‐ airbnb://rooms/5259603 -‐-‐>
<activity android:name="com.airbnb.ShowRoom”>
<intent-‐filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="airbnb" android:host="rooms" />
</intent-‐filter>
</activity>
DroidCon
Example: Defining Deep Links – Handling the Intent
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent intent = getIntent();
Uri data = intent.getData();
String path = data.getPath();
}
DroidCon
Publishing – Do you have a website? <!–-‐ Google App Indexing -‐-‐>
<link href="android-‐app://com.yelp.android/yelp-‐app-‐indexing/biz/
PbwkBPAyw"/>
<!–-‐ Facebook’s AppLink -‐-‐>
<meta property="al:android:url" content="etsy://listing/190881511"/>
<!–-‐ Twitter’s Card -‐-‐>
<meta name="twitter:app:url:googleplay" value="etsy://listing/19881511"/>
<!–-‐ AppURL -‐-‐>
<link type="x-‐edition/android-‐newest" href="http://example.com/123"/>
DroidCon
Example: Publishing – Web to Native – Google App Indexing <link href="android-‐app://com.yelp.android/yelp-‐app-‐indexing/biz/
PbwkBPpiXqKQR7fPJvGAyw?
utm_campaign=biz_details&utm_medium=organic&utm_source=google"
rel="alternate" />
<link href="ios-‐app://284910350/yelp/biz/PbwkBPpiXqKQR7fPJvGAyw?
utm_campaign=biz_details&utm_medium=organic&utm_source=google"
rel="alternate" />
DroidCon
Example: Publishing – Web to Native Sitemap – Google App Indexing
<?xml version="1.0" encoding="UTF-‐8" ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>http://grid6.us/example1</loc>
<xhtml:link rel="alternate" href="android-‐app://us.grid6/http/
grid6.us/example1" />
</url>
</urlset>
DroidCon
Publishing – only have an app?
• Publish Directly to Google using GoogleApiClient, from the Activity, during client run-time.
GoogleApiClient mClient = new GoogleApiClient.Builder(this). addApi(AppIndex.APP_INDEX_API).build(); // inside onCreate
AppIndex.AppIndexApi.view(mClient, <page data>); // inside onStart
DroidCon
Mobile Deep Linking
• Powerful for users • Can help drive growth, engagement and monetization
• Easy to implement