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
9. Agenda
+The Google+ Sign-In Button
+Personalizing Your App
+Involve Close Friends with Targeted Sharing
4
Tuesday, July 23, 13
10. 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
32. 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
33. 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
34. 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
35. 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
36. 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
37. 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
38. 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
39. 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
40. 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
41. 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
42. 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
43. Google+ Sign-In (button): Android
@Override
protected 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
51. 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
52. 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
53. 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
54. 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
55. 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
65. Check out the delicious dishes
at La Mar Cebicheria Peruana
Tuesday, July 23, 13
66. 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
76. 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
77. 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
78. 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,leeroy.jenkins@example.com"
Share!
</button>
48
Prefill Recipients & Share Text
JS
Tuesday, July 23, 13
79. 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,leeroy.jenkins@example.com"
Share!
</button>
49
Also a Sign-In Button!
JS
Tuesday, July 23, 13
82. Surface Activities on Google
when they matter
Writing App Activities
Tuesday, July 23, 13
83. 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
FollowFandango
7,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
Oblivion
PG-13, 2 hr 5 min
2,044 watched the trailer
42
PG-13, 2 hr 8 min
1,903 watched the trailer
The Croods
PG, 1 hr 31 min
1,968 watched the trailer
Scary Movie V
PG-13, 1 hr 25 min
1,761 watched the trailer
Popular with Google+ users
Tuesday, July 23, 13
84. 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
FollowFandango
7,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
Oblivion
PG-13, 2 hr 5 min
2,044 watched the trailer
42
PG-13, 2 hr 8 min
1,903 watched the trailer
The Croods
PG, 1 hr 31 min
1,968 watched the trailer
Scary Movie V
PG-13, 1 hr 25 min
1,761 watched the trailer
Popular with Google+ users
Tuesday, July 23, 13
92. Review
+The Google+ Sign-In Button
+Personalizing Your App
+Involve Close Friends with Targeted Sharing
56
Tuesday, July 23, 13
93. 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
94. 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