SlideShare a Scribd company logo
Let's your users share your
App with Friends:
APP INVITES FOR ANDROID
Story Time!
@ewilly1
Android Developer
Why Should I care ?
 Let's your users share your App with Friends: App Invites for Android
 Let's your users share your App with Friends: App Invites for Android
 Let's your users share your App with Friends: App Invites for Android
Word of mouth Legacy
Word of mouth Legacy
Word of mouth Legacy
We (USERS) care about
“Happiness only real when shared.”
Christopher McCandless
Bad and Good Pattern
Please don’t stalk
Bad and Good Pattern
The smart way:
be ready be kind
Recap
Google App Invite API
How does it work ?
Let’s add it to our app
Prepare
Setup
Configuration File
Code
Prepare
Setup manifest
<meta-data
android:name="com.google.android.gms.version" android:
value="@integer/google_play_services_version" />
Setup gradle
APP
compile 'com.google.android.gms:play-services-appinvite:8.3.0'
PROJECT
classpath 'com.google.gms:google-services:1.5.0-beta2'
Configuration
File
Google developer
console
Enable App Invite API
SHA-1 key
Download your file
 Let's your users share your App with Friends: App Invites for Android
Code
1. Connect Google Client API with APP Invite Service Enabled
2. Start App Invite Intent
3. handle the result in the callback
4. Check if someone installed the app from an invitation
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addApi(AppInvite.API)
.enableAutoManage(this, this)
.build();
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addApi(AppInvite.API)
.enableAutoManage(this, this)
.build();
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addApi(AppInvite.API)
.enableAutoManage(this, this)
.build();
@Override
protected void onStart() {
super.onStart();
mGoogleApiClient.connect();
}
@Override
protected void onStop() {
super.onStop();
mGoogleApiClient.disconnect();
}
@Override
protected void onStart() {
super.onStart();
mGoogleApiClient.connect();
}
@Override
protected void onStop() {
super.onStop();
mGoogleApiClient.disconnect();
}
public void onConnectionFailed(ConnectionResult connectionResult)
{
Log.d(TAG, "onConnectionFailed:" + connectionResult);
showMessage(getString(R.string.google_play_services_error));
}
private void onInviteClicked() {
Intent intent = new AppInviteInvitation.IntentBuilder(getString(R.string.invitation_title))
.setMessage(getString(R.string.invitation_message))
.setDeepLink(Uri.parse(getString(R.string.invitation_deep_link)))
.setCustomImage(Uri.parse(getString(R.string.invitation_custom_image)))
.setCallToActionText(getString(R.string.invitation_cta))
.build();
startActivityForResult(intent, REQUEST_INVITE);
}
private void onInviteClicked() {
Intent intent = new AppInviteInvitation.IntentBuilder(getString(R.string.invitation_title))
.setMessage(getString(R.string.invitation_message))
.setDeepLink(Uri.parse(getString(R.string.invitation_deep_link)))
.setCustomImage(Uri.parse(getString(R.string.invitation_custom_image)))
.setCallToActionText(getString(R.string.invitation_cta))
.build();
startActivityForResult(intent, REQUEST_INVITE);
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Log.d(TAG, "onActivityResult: requestCode=" + requestCode + ", resultCode=" + resultCode);
if (requestCode == REQUEST_INVITE) {
if (resultCode == RESULT_OK) {
String[] ids = AppInviteInvitation.getInvitationIds(resultCode, data);
Log.d(TAG, getString(R.string.sent_invitations_fmt, ids.length));
} else {
showMessage(getString(R.string.send_failed));
}
}
}
protected void onCreate(Bundle savedInstanceState) {
boolean autoLaunchDeepLink = true;
AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, autoLaunchDeepLink)
.setResultCallback(
new ResultCallback<AppInviteInvitationResult>() {
@Override
public void onResult(AppInviteInvitationResult result) {
Log.d(TAG, "getInvitation:onResult:" + result.getStatus());
}
});
}
protected void onCreate(Bundle savedInstanceState) {
boolean autoLaunchDeepLink = true;
AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, autoLaunchDeepLink)
.setResultCallback(
new ResultCallback<AppInviteInvitationResult>() {
@Override
public void onResult(AppInviteInvitationResult result) {
Log.d(TAG, "getInvitation:onResult:" + result.getStatus());
}
});
}
protected void onCreate(Bundle savedInstanceState) {
boolean autoLaunchDeepLink = true;
AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, autoLaunchDeepLink)
.setResultCallback(
new ResultCallback<AppInviteInvitationResult>() {
@Override
public void onResult(AppInviteInvitationResult result) {
Log.d(TAG, "getInvitation:onResult:" + result.getStatus());
}
});
}
Recap
Numbers matters
Let's measure it
Overview of Google Analytics API
measure user activity
Collection - Configuration - Processing - Reporting
Integrating Google Analytics API to
measure your invites
Prepare
Setup
Get tracking Id
Configuration File
Code
Prepare
 Let's your users share your App with Friends: App Invites for Android
Setup manifest
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application android:name="AnalyticsApplication">
...
</application>
Setup gradle
APP
apply plugin: 'com.google.gms.google-services'
compile 'com.google.android.gms:play-services-analytics:8.3.0'
Tracking ID
Create Account
Add a Mobile Project to track -> Tracking ID
Configure Analytics to process App Invites data
Create App Invite DashBoard
Configuration
File
Google developer
console
Enable Analytics API
Download your file
Code
1. Create a Tracker
2. Generate Event (sent and received invites)
Application level
public static Tracker tracker() {
return tracker;
}
@Override
public void onCreate() {
super.onCreate();
analytics = GoogleAnalytics.getInstance(this);
tracker = analytics.newTracker(TRACKING-ID);
tracker.enableExceptionReporting(true);
tracker.enableAdvertisingIdCollection(true);
tracker.enableAutoActivityTracking(true);
}
Application level
public static Tracker tracker() {
return tracker;
}
@Override
public void onCreate() {
super.onCreate();
analytics = GoogleAnalytics.getInstance(this);
tracker = analytics.newTracker(TRACKING-ID);
tracker.enableExceptionReporting(true);
tracker.enableAdvertisingIdCollection(true);
tracker.enableAutoActivityTracking(true);
}
Invite sent
// Get tracker.
Tracker t = ((KitApplication) getApplication()).
tracker();
// Build and send an Event.
t.send(new HitBuilders.EventBuilder()
.setCategory(getString(R.string.category_id))
.setAction(getString(R.string.sent))
.build());
Invite sent
// Get tracker.
Tracker t = ((KitApplication) getApplication()).
tracker();
// Build and send an Event.
t.send(new HitBuilders.EventBuilder()
.setCategory(getString(R.string.category_id))
.setAction(getString(R.string.sent))
.build());
Invite received
Tracker t = ((MYApplication) getApplication()).
tracker();
// Build and send an Event.
t.send(new HitBuilders.EventBuilder()
.setCategory(getString(R.string.category_id))
.setAction(getString(R.string.accepted))
.build());
Let's see some numbers
Recap
Show time
(Live test)
Video
https://goo.gl/Gk0iMY
@ewilly1
mbouendaw@yahoo.fr
Code:goo.gl/POESae
Slides:goo.gl/PBkzVm
Thanks for your attention!
Q & A

More Related Content

PDF
AI: Integrate Search Function into Your App Using Bing Search API.
PDF
Google Play Services Rock
PDF
Google Fit, Android Wear & Xamarin
PDF
Introduction to Android Wear
PDF
Wave Workshop
PPTX
Grails Advanced
PDF
React native app with type script tutorial
PDF
Cómo tener analíticas en tu app y no volverte loco
AI: Integrate Search Function into Your App Using Bing Search API.
Google Play Services Rock
Google Fit, Android Wear & Xamarin
Introduction to Android Wear
Wave Workshop
Grails Advanced
React native app with type script tutorial
Cómo tener analíticas en tu app y no volverte loco

What's hot (20)

PDF
Visual Component Testing -- w/ Gil Tayar (Applitools) and Gleb Bahmutov (Cyp...
PPTX
Lviv MDDay 2014. Ігор Коробка “забезпечення базової безпеки в андроїд аплікац...
PDF
Android - Intents and Broadcast Receivers
PDF
Android TV: Building apps with Google’s Leanback Library
PDF
ComponenKit and React Native
PPTX
Session #8 adding magic to your app
PDF
Introduction to ReactJS and Redux
PPTX
Android tv get started
PDF
Mixpanel Integration in Android
PDF
Getting your app ready for android n
PPTX
A (very) opinionated guide to MSBuild and Project Files
PDF
Android N Highligts
PPTX
Lowering in C#: What really happens with your code?, from NDC Oslo 2019
PDF
Introduction to React & Redux
PDF
Rails Plugins - Linux For You, March 2011 Issue
PDF
Front End Development for Back End Developers - Denver Startup Week 2017
PDF
Lessons Learned Implementing a GraphQL API
PDF
How to build crud application using vue js, graphql, and hasura
PDF
"Taster Slides" for Most advanced GTM implementation
PPT
GAS Session
Visual Component Testing -- w/ Gil Tayar (Applitools) and Gleb Bahmutov (Cyp...
Lviv MDDay 2014. Ігор Коробка “забезпечення базової безпеки в андроїд аплікац...
Android - Intents and Broadcast Receivers
Android TV: Building apps with Google’s Leanback Library
ComponenKit and React Native
Session #8 adding magic to your app
Introduction to ReactJS and Redux
Android tv get started
Mixpanel Integration in Android
Getting your app ready for android n
A (very) opinionated guide to MSBuild and Project Files
Android N Highligts
Lowering in C#: What really happens with your code?, from NDC Oslo 2019
Introduction to React & Redux
Rails Plugins - Linux For You, March 2011 Issue
Front End Development for Back End Developers - Denver Startup Week 2017
Lessons Learned Implementing a GraphQL API
How to build crud application using vue js, graphql, and hasura
"Taster Slides" for Most advanced GTM implementation
GAS Session
Ad

Similar to Let's your users share your App with Friends: App Invites for Android (20)

PDF
Android Meetup Slovenia #2 - Making your app location-aware
PDF
Infinum Android Talks #9 - Making your app location-aware
PDF
[Android] Google Service Play & Google Maps
KEY
Android workshop
PPTX
Google Plus SignIn : l'Authentification Google
PPTX
PPTX
Slide Deck - Shift Left Beyond App Performance Improvement at Gojek_.pptx
PDF
Phone gap 12 things you should know
PDF
Android Quiz App – Test Your IQ.pdf
PDF
Introduction to Google App Engine
PPTX
Integrating GoogleFit into Android Apps
PPT
Android Froyo
PDF
Opticon 2015 - Getting Started with the Optimizely Developer Platform
PDF
Hands on App Engine
PDF
TDC2016SP - Trilha Android
PPTX
Cloud Endpoints _Polymer_ Material design by Martin Görner
PDF
Night Watch with QA
PDF
OSCON Google App Engine Codelab - July 2010
PDF
Serverless Angular, Material, Firebase and Google Cloud applications
PDF
Testing your application on Google App Engine
Android Meetup Slovenia #2 - Making your app location-aware
Infinum Android Talks #9 - Making your app location-aware
[Android] Google Service Play & Google Maps
Android workshop
Google Plus SignIn : l'Authentification Google
Slide Deck - Shift Left Beyond App Performance Improvement at Gojek_.pptx
Phone gap 12 things you should know
Android Quiz App – Test Your IQ.pdf
Introduction to Google App Engine
Integrating GoogleFit into Android Apps
Android Froyo
Opticon 2015 - Getting Started with the Optimizely Developer Platform
Hands on App Engine
TDC2016SP - Trilha Android
Cloud Endpoints _Polymer_ Material design by Martin Görner
Night Watch with QA
OSCON Google App Engine Codelab - July 2010
Serverless Angular, Material, Firebase and Google Cloud applications
Testing your application on Google App Engine
Ad

More from Wilfried Mbouenda Mbogne (8)

PDF
In 10 years i have
PDF
How to resolve a Linear Programming Problem using Simplex Algorithm?
PDF
Capire le basi di un coro in parrocchia
PPTX
La serata del ndole
PPT
Servizi online della Microsoft per gli studenti
PPT
Microsoft Student Partner
PPT
Imagine Cup 2011
PPT
Le pouvoir de la concentration
In 10 years i have
How to resolve a Linear Programming Problem using Simplex Algorithm?
Capire le basi di un coro in parrocchia
La serata del ndole
Servizi online della Microsoft per gli studenti
Microsoft Student Partner
Imagine Cup 2011
Le pouvoir de la concentration

Recently uploaded (20)

PPTX
Tartificialntelligence_presentation.pptx
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
Architecture types and enterprise applications.pdf
PDF
STKI Israel Market Study 2025 version august
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PDF
Getting Started with Data Integration: FME Form 101
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Developing a website for English-speaking practice to English as a foreign la...
PPT
What is a Computer? Input Devices /output devices
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PPT
Module 1.ppt Iot fundamentals and Architecture
PPTX
The various Industrial Revolutions .pptx
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Hybrid model detection and classification of lung cancer
PDF
2021 HotChips TSMC Packaging Technologies for Chiplets and 3D_0819 publish_pu...
Tartificialntelligence_presentation.pptx
Final SEM Unit 1 for mit wpu at pune .pptx
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Architecture types and enterprise applications.pdf
STKI Israel Market Study 2025 version august
O2C Customer Invoices to Receipt V15A.pptx
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
Getting Started with Data Integration: FME Form 101
OMC Textile Division Presentation 2021.pptx
Developing a website for English-speaking practice to English as a foreign la...
What is a Computer? Input Devices /output devices
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Module 1.ppt Iot fundamentals and Architecture
The various Industrial Revolutions .pptx
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Programs and apps: productivity, graphics, security and other tools
Hybrid model detection and classification of lung cancer
2021 HotChips TSMC Packaging Technologies for Chiplets and 3D_0819 publish_pu...

Let's your users share your App with Friends: App Invites for Android