97
Developers Tuesday, July 23, 13

CIS13: An Introduction to Integrating Google+ Sign-In

Embed Size (px)

DESCRIPTION

Jonathan Beri, Developer Advocate, Google+ Presentation discusses: The Google+ Sign-In Button Personalizing Your App Involve Close Friends with Targeted Sharing Surfacing Relevant Actions Across Google

Citation preview

Page 1: CIS13: An Introduction to Integrating Google+ Sign-In

Developers

Tuesday, July 23, 13

Page 2: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 3: CIS13: An Introduction to Integrating Google+ Sign-In

An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 4: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 5: CIS13: An Introduction to Integrating Google+ Sign-In

Jonathan Beri

Developer Advocate, Google+google.com/+JonathanBeri

Tuesday, July 23, 13

Page 6: CIS13: An Introduction to Integrating Google+ Sign-In

Agenda

4

Tuesday, July 23, 13

Page 7: CIS13: An Introduction to Integrating Google+ Sign-In

Agenda

+The Google+ Sign-In Button

4

Tuesday, July 23, 13

Page 8: CIS13: An Introduction to Integrating Google+ Sign-In

Agenda

+The Google+ Sign-In Button+Personalizing Your App

4

Tuesday, July 23, 13

Page 9: CIS13: An Introduction to Integrating Google+ Sign-In

Agenda

+The Google+ Sign-In Button+Personalizing Your App+Involve Close Friends with Targeted Sharing

4

Tuesday, July 23, 13

Page 10: CIS13: An Introduction to Integrating Google+ Sign-In

Agenda

+The Google+ Sign-In Button+Personalizing Your App+Involve Close Friends with Targeted Sharing+Surfacing Relevant Actions Across Google

4

Tuesday, July 23, 13

Page 11: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 12: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 13: CIS13: An Introduction to Integrating Google+ Sign-In

Thinking SocialIt starts with people and connections

Tuesday, July 23, 13

Page 14: CIS13: An Introduction to Integrating Google+ Sign-In

New Users & Engagement

6

Tuesday, July 23, 13

Page 15: CIS13: An Introduction to Integrating Google+ Sign-In

New Users & Engagement

6

New Users

Tuesday, July 23, 13

Page 16: CIS13: An Introduction to Integrating Google+ Sign-In

New Users & Engagement

6

New Users Engagement

Tuesday, July 23, 13

Page 17: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 18: CIS13: An Introduction to Integrating Google+ Sign-In

Google+ Sign-InCapture new users with a button

Tuesday, July 23, 13

Page 19: CIS13: An Introduction to Integrating Google+ Sign-In

The Google+ Sign-In Button

8

Sign in with Google

Tuesday, July 23, 13

Page 20: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 21: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 22: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 23: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 24: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 25: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 26: CIS13: An Introduction to Integrating Google+ Sign-In

10

Tuesday, July 23, 13

Page 27: CIS13: An Introduction to Integrating Google+ Sign-In

10

Tuesday, July 23, 13

Page 28: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 29: CIS13: An Introduction to Integrating Google+ Sign-In

The Google+ Sign-In ButtonAdding the code

Tuesday, July 23, 13

Page 30: CIS13: An Introduction to Integrating Google+ Sign-In

Developers.google.com/+

12

Tuesday, July 23, 13

Page 31: CIS13: An Introduction to Integrating Google+ Sign-In

Code.google.com/apis/console

13

Tuesday, July 23, 13

Page 32: CIS13: An Introduction to Integrating Google+ Sign-In

Google+ Sign-In (button): Web

<span id="signinButton"> <span class="g-signin" data-clientid="CLIENT_ID" data-scope="https://www.googleapis.com/auth/plus.login" data-cookiepolicy="single_host_origin" data-requestvisibleactions="http://schemas.google.com/AddActivity" data-callback="signinCallback"> </span></span>

14

The HTML

HTML

Tuesday, July 23, 13

Page 33: CIS13: An Introduction to Integrating Google+ Sign-In

Google+ Sign-In (button): Web

<span id="signinButton"> <span class="g-signin" data-clientid="CLIENT_ID" data-scope="https://www.googleapis.com/auth/plus.login" data-cookiepolicy="single_host_origin" data-requestvisibleactions="http://schemas.google.com/AddActivity" data-callback="signinCallback"> </span></span>

15

The HTML

HTML

Tuesday, July 23, 13

Page 34: CIS13: An Introduction to Integrating Google+ Sign-In

Google+ Sign-In (button): Web

<span id="signinButton"> <span class="g-signin" data-clientid="CLIENT_ID" data-scope="https://www.googleapis.com/auth/plus.login" data-cookiepolicy="single_host_origin" data-requestvisibleactions="http://schemas.google.com/AddActivity" data-callback="signinCallback"> </span></span>

16

The HTML

HTML

Tuesday, July 23, 13

Page 35: CIS13: An Introduction to Integrating Google+ Sign-In

Google+ Sign-In (button): Web

<span id="signinButton"> <span class="g-signin" data-clientid="CLIENT_ID" data-scope="https://www.googleapis.com/auth/plus.login" data-cookiepolicy="single_host_origin" data-requestvisibleactions="http://schemas.google.com/AddActivity" data-callback="signinCallback"> </span></span>

17

The HTML

HTML

Tuesday, July 23, 13

Page 36: CIS13: An Introduction to Integrating Google+ Sign-In

Google+ Sign-In (button): Web

<span id="signinButton"> <span class="g-signin" data-clientid="CLIENT_ID" data-scope="https://www.googleapis.com/auth/plus.login" data-cookiepolicy="single_host_origin" data-requestvisibleactions="http://schemas.google.com/AddActivity" data-callback="signinCallback"> </span></span>

18

The HTML

HTML

Tuesday, July 23, 13

Page 37: CIS13: An Introduction to Integrating Google+ Sign-In

Google+ Sign-In (button): Web

<span id="signinButton"> <span class="g-signin" data-clientid="CLIENT_ID" data-scope="https://www.googleapis.com/auth/plus.login" data-cookiepolicy="single_host_origin" data-requestvisibleactions="http://schemas.google.com/AddActivity" data-callback="signinCallback"> </span></span>

19

The HTML

HTML

Tuesday, July 23, 13

Page 38: CIS13: An Introduction to Integrating Google+ Sign-In

Google+ Sign-In (button): Web

<span id="signinButton"> <span class="g-signin" data-clientid="CLIENT_ID" data-scope="https://www.googleapis.com/auth/plus.login" data-cookiepolicy="single_host_origin" data-requestvisibleactions="http://schemas.google.com/AddActivity" data-callback="signinCallback"> </span></span>

20

The HTML

HTML

Tuesday, July 23, 13

Page 39: CIS13: An Introduction to Integrating Google+ Sign-In

Google+ Sign-In (button): Web

<script type="text/javascript" > (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/client:plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })();</script>

21

The JavaScript

JS

Tuesday, July 23, 13

Page 40: CIS13: An Introduction to Integrating Google+ Sign-In

Google+ Sign-In (button): Web

<script type="text/javascript" > (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/client:plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })();</script>

22

The JavaScript

JS

Tuesday, July 23, 13

Page 41: CIS13: An Introduction to Integrating Google+ Sign-In

Google+ Sign-In (button): Web

<span id="signinButton"> <span class="g-signin" data-apppackagename="com.google.android.apps.plus" data-clientid="CLIENT_ID" data-scope="https://www.googleapis.com/auth/plus.login" data-cookiepolicy="single_host_origin" data-requestvisibleactions="http://schemas.google.com/AddActivity" data-callback="signinCallback"> </span></span>

23

App Installs: Over-The-Air

HTML

Tuesday, July 23, 13

Page 42: CIS13: An Introduction to Integrating Google+ Sign-In

Google+ Sign-In (button): Web

<span id="signinButton"> <span class="g-signin" data-apppackagename="com.google.android.apps.plus" data-clientid="CLIENT_ID" data-scope="https://www.googleapis.com/auth/plus.login" data-cookiepolicy="single_host_origin" data-requestvisibleactions="http://schemas.google.com/AddActivity" data-callback="signinCallback"> </span></span>

24

App Installs: Over-The-Air

HTML

Tuesday, July 23, 13

Page 43: CIS13: An Introduction to Integrating Google+ Sign-In

Google+ Sign-In (button): Android

@Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mPlusClient = new PlusClient.Builder(this, this, this) .setScopes(Scopes.PLUS_LOGIN) .setVisibleActivities("http://schemas.google.com/AddActivity") .build(); mPlusClient.connect();}

25

Google Play Services & PlusClient

Java

Tuesday, July 23, 13

Page 44: CIS13: An Introduction to Integrating Google+ Sign-In

Google+ Sign-In (button): iOS

#import <GooglePlus/GooglePlus.h>#import <GoogleOpenSource/GoogleOpenSource.h>

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { GPPSignIn *signIn = [GPPSignIn sharedInstance]; signIn.clientID = @"CLIENT_ID"; signIn.scopes = @[@"https://www.googleapis.com/auth/plus.login"]; signIn.actions = @[@"http://schemas.google.com/AddActivity"];}

26

iOS Framework

Obj-C

Tuesday, July 23, 13

Page 45: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 46: CIS13: An Introduction to Integrating Google+ Sign-In

Personalizing Your AppIntegrating profile and connection data more deeply

Tuesday, July 23, 13

Page 47: CIS13: An Introduction to Integrating Google+ Sign-In

Quickly Create Profiles

28

Tuesday, July 23, 13

Page 48: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 49: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 50: CIS13: An Introduction to Integrating Google+ Sign-In

Personalizing Your AppAdding the code

Tuesday, July 23, 13

Page 51: CIS13: An Introduction to Integrating Google+ Sign-In

Personalizing Your App

gapi.client.load(‘plus’, ‘v1’, function() { var request = gapi.client.plus.people.get({ 'userId': "me" }); request.execute(function(resp) { console.log('Retrieved profile:' + resp.displayName); });});

31

Retrieve a profile

JS

Tuesday, July 23, 13

Page 52: CIS13: An Introduction to Integrating Google+ Sign-In

Personalizing Your App

gapi.client.load(‘plus’, ‘v1’, function() { var request = gapi.client.plus.people.get({ 'userId': "me" }); request.execute(function(resp) { console.log('Retrieved profile:' + resp.displayName); });});

32

Retrieve a profile

JS

Tuesday, July 23, 13

Page 53: CIS13: An Introduction to Integrating Google+ Sign-In

Personalizing Your App

gapi.client.load(‘plus’, ‘v1’, function() { var request = gapi.client.plus.people.get({ 'userId': "me" }); request.execute(function(resp) { console.log('Retrieved profile:' + resp.displayName); });});

33

Retrieve a profile

JS

Tuesday, July 23, 13

Page 54: CIS13: An Introduction to Integrating Google+ Sign-In

Personalizing Your App

var friends = gapi.client.plus.people.list({ 'userId': "me", 'collection': "visible"});friends.execute(function(resp) { console.log('Num people visible:' + resp.totalItems);});

34

Retrieve a list of friends

JS

Tuesday, July 23, 13

Page 55: CIS13: An Introduction to Integrating Google+ Sign-In

Personalizing Your App

var friends = gapi.client.plus.people.list({ 'userId': "me", 'collection': "visible"});friends.execute(function(resp) { console.log('Num people visible:' + resp.totalItems);});

35

Retrieve a list of friends

JS

Tuesday, July 23, 13

Page 56: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 57: CIS13: An Introduction to Integrating Google+ Sign-In

Involve Close Friends with Targeted SharingGet friends to join from the stream with Interactive Posts

Tuesday, July 23, 13

Page 58: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 59: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 60: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 61: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 62: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 63: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 64: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 65: CIS13: An Introduction to Integrating Google+ Sign-In

Check out the delicious dishes at La Mar Cebicheria Peruana

Tuesday, July 23, 13

Page 66: CIS13: An Introduction to Integrating Google+ Sign-In

6:14

Jonathan Beri shared with you:Check out the delicious dishes at...

Jonathan Beri shared with you: Check out the delicious dishes at...

Tuesday, July 23, 13

Page 67: CIS13: An Introduction to Integrating Google+ Sign-In

Jonathan Beri

6:14

Mascone West

Check out the delicious dishes at Tía Pol!

Jonathan Beri

Tuesday, July 23, 13

Page 68: CIS13: An Introduction to Integrating Google+ Sign-In

6:15

Tía Pol

Tuesday, July 23, 13

Page 69: CIS13: An Introduction to Integrating Google+ Sign-In

A Button for Every Social Action

Tuesday, July 23, 13

Page 70: CIS13: An Introduction to Integrating Google+ Sign-In

A Button for Every Social Action

Jonathan BeriBrett JohnsonJonathan BeriBrett Johnson

Tuesday, July 23, 13

Page 71: CIS13: An Introduction to Integrating Google+ Sign-In

A Button for Every Social Action

Joanna SmithJoanna Smith

Tuesday, July 23, 13

Page 72: CIS13: An Introduction to Integrating Google+ Sign-In

A Button for Every Social Action

Tuesday, July 23, 13

Page 73: CIS13: An Introduction to Integrating Google+ Sign-In

A Button for Every Social Action

Tuesday, July 23, 13

Page 74: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 75: CIS13: An Introduction to Integrating Google+ Sign-In

Involve Close Friends with Targeted SharingAdding the code

Tuesday, July 23, 13

Page 76: CIS13: An Introduction to Integrating Google+ Sign-In

Involve Close Friends

<button class=”g-interactivepost” data-clientid="CLIENT_ID" data-scope="https://www.googleapis.com/auth/plus.login" data-cookiepolicy="single_host_origin" data-requestvisibleactions="http://schemas.google.com/AddActivity" data-calltoactionlabel="CREATE" data-calltoactionurl="http://plus.google.com/pages/create" data-calltoactiondeeplinkid="/pages/create"> Share!</button>

46

Interactive Post (HTML)

JS

Tuesday, July 23, 13

Page 77: CIS13: An Introduction to Integrating Google+ Sign-In

Involve Close Friends

<button class=”g-interactivepost” data-clientid="CLIENT_ID" data-scope="https://www.googleapis.com/auth/plus.login" data-cookiepolicy="single_host_origin" data-requestvisibleactions="http://schemas.google.com/AddActivity" data-calltoactionlabel="CREATE" data-calltoactionurl="http://plus.google.com/pages/create" data-calltoactiondeeplinkid="/pages/create"> Share!</button>

47

Setting up Labels & Call-To-Action

JS

Tuesday, July 23, 13

Page 78: CIS13: An Introduction to Integrating Google+ Sign-In

Involve Close Friends

<button class=”g-interactivepost” data-clientid="CLIENT_ID" data-scope="https://www.googleapis.com/auth/plus.login" data-cookiepolicy="single_host_origin" data-requestvisibleactions="http://schemas.google.com/AddActivity" ... data-prefilltext="Create a Google+ page for your business." data-recipients="110967630299632321627,[email protected]" Share!</button>

48

Prefill Recipients & Share Text

JS

Tuesday, July 23, 13

Page 79: CIS13: An Introduction to Integrating Google+ Sign-In

Involve Close Friends

<button class=”g-interactivepost” data-clientid="CLIENT_ID" data-scope="https://www.googleapis.com/auth/plus.login" data-cookiepolicy="single_host_origin" data-requestvisibleactions="http://schemas.google.com/AddActivity" ... data-prefilltext="Create a Google+ page for your business." data-recipients="110967630299632321627,[email protected]" Share!</button>

49

Also a Sign-In Button!

JS

Tuesday, July 23, 13

Page 80: CIS13: An Introduction to Integrating Google+ Sign-In

Involve Close Friends

- (IBAction)share:(id)sender { id<GPPShareBuilder> shareDialog = [[GPPShare sharedInstance] shareDialog]; [shareDialog setCallToActionButtonWithLabel:@"CREATE" URL: [NSURL URLWithString:@"https://developers.google.com/+/mobile/ios/"] deepLinkID:@"/+/mobile/ios/"]; [shareDialog open];}

50

iOS

JS

Tuesday, July 23, 13

Page 81: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 82: CIS13: An Introduction to Integrating Google+ Sign-In

Surface Activities on Google when they matterWriting App Activities

Tuesday, July 23, 13

Page 83: CIS13: An Introduction to Integrating Google+ Sign-In

40 personal results. 24,700,000 other results.

Images Maps Shopping News More ▾ Search tools

Ardan Arac

+Ardan Search Images Mail Drive Calendar Sites Groups Contacts More ▾

▾3 Share

Web

fandango

FollowFandango7,912 followers on Google+

Recent post

Joss Whedon Talks Thanos, 'Avengers 2 & 3' and RDJ in 'Iron Man 3' on our movie blog. 3 hours ago

OblivionPG-13, 2 hr 5 min2,044 watched the trailer

42PG-13, 2 hr 8 min1,903 watched the trailer

The CroodsPG, 1 hr 31 min1,968 watched the trailer

Scary Movie VPG-13, 1 hr 25 min1,761 watched the trailer

Popular with Google+ users

Tuesday, July 23, 13

Page 84: CIS13: An Introduction to Integrating Google+ Sign-In

40 personal results. 24,700,000 other results.

Images Maps Shopping News More ▾ Search tools

Ardan Arac

+Ardan Search Images Mail Drive Calendar Sites Groups Contacts More ▾

▾3 Share

Web

fandango

FollowFandango7,912 followers on Google+

Recent post

Joss Whedon Talks Thanos, 'Avengers 2 & 3' and RDJ in 'Iron Man 3' on our movie blog. 3 hours ago

OblivionPG-13, 2 hr 5 min2,044 watched the trailer

42PG-13, 2 hr 8 min1,903 watched the trailer

The CroodsPG, 1 hr 31 min1,968 watched the trailer

Scary Movie VPG-13, 1 hr 25 min1,761 watched the trailer

Popular with Google+ users

Tuesday, July 23, 13

Page 85: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 86: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 87: CIS13: An Introduction to Integrating Google+ Sign-In

Surface Activities on Google when they matterAdding the code

Tuesday, July 23, 13

Page 88: CIS13: An Introduction to Integrating Google+ Sign-In

Involve Close Friends

moment = {“type” : “http://schamas.google.com/BuyActivity”, "target": { "url": "https://developers.google.com/+/plugins/snippet/examples/thing" } }google_request = service.moments().insert(userId='me', collection='vault', body=moment)momentResult = google_request.execute()

55

Server-Side (Python)

Python

Tuesday, July 23, 13

Page 89: CIS13: An Introduction to Integrating Google+ Sign-In

Review

56

Tuesday, July 23, 13

Page 90: CIS13: An Introduction to Integrating Google+ Sign-In

Review

+The Google+ Sign-In Button

56

Tuesday, July 23, 13

Page 91: CIS13: An Introduction to Integrating Google+ Sign-In

Review

+The Google+ Sign-In Button+Personalizing Your App

56

Tuesday, July 23, 13

Page 92: CIS13: An Introduction to Integrating Google+ Sign-In

Review

+The Google+ Sign-In Button+Personalizing Your App+Involve Close Friends with Targeted Sharing

56

Tuesday, July 23, 13

Page 93: CIS13: An Introduction to Integrating Google+ Sign-In

Review

+The Google+ Sign-In Button+Personalizing Your App+Involve Close Friends with Targeted Sharing+Surfacing Relevant Actions Across Google

56

Tuesday, July 23, 13

Page 94: CIS13: An Introduction to Integrating Google+ Sign-In

Credits• New User designed by Yuri Mamaev from The Noun Project• Click designed by Rohan Gupta from The Noun Project

57

Tuesday, July 23, 13

Page 95: CIS13: An Introduction to Integrating Google+ Sign-In

Tuesday, July 23, 13

Page 96: CIS13: An Introduction to Integrating Google+ Sign-In

<Thank You!>developers.google.com/+plus.google.com/+GooglePlusDevelopersstackoverflow.com/questions/tagged/google-plus

Jonathan Beri, google.com/+JonathanBeri

Tuesday, July 23, 13

Page 97: CIS13: An Introduction to Integrating Google+ Sign-In

Developers

Tuesday, July 23, 13