SlideShare a Scribd company logo
1 of 22
Google+ Sign-in for Mobile
and Web
By +Lakhdar Meftah
Simple, secure
authentication
Interactive
posts
Over-the-air
installs
Integrated
Hangouts
Profile & social
graph access
Lasting re-
engagement
Engagement
analytics
Google+
plugins
Google+ Sign-In
Simple, secure authentication
Build on a
trusted
relationship
Works with
your existing
sign-in systems
Cross-platform single sign on
Avoid the hassle of
creating your own
authentication system
Learn more about
your users and
their friend
Give users
more choice
Interactive Posts
Stand out in the stream
Drive action
Customize the post
Measure impact
Interactive post flow
Pull people into your app to
take specific actions
Over-The-Air Installs
Stay connected to users across their devices
Drive automatic
Android downloads
from your website
sign-ins
One-step download
to a user's device
Measure your
downloads
Google+ Hangouts:
Some things are better face to face
App Customization
Customize content and suggest connections for your users
Improve engagement through
users' connections
Create accurate
profiles
Connect
friends
Spark content
discovery
Create dynamic
marketing campaigns
App Activities
Increase app discovery and drive lasting re-engagement
Build conversations
and share activities
that matter
App activities in
Google Search
Be found on user's
Google+ profile
Google+ Platform Insights
Meaningful analytics to optimize your integration
Get the most out of
Google+ Sign-In
Understand your
users
Dig deeper into post
performance
Optimize your
integration based on
user activity
Monitor installs to
your Android app
Plugins
Grow your audience through identity, relationships, and sharing.
+1 button
Badge
Recommendations
Share
Follow button
Snippest
In Depth
1. Enable the Google+ API
2. Configure your Eclipse project
3. Run the Google+ sample app
4. Initialize the PlusClient
1. Create a Google APIs Console project .
1.Add the Google+ Sign-In button to your app
2.Sign out the user
3.Revoking access tokens and disconnecting the app
4.Customizing your sign-in button
5.Localization
6.Server-side access for your app
2. Google+ Sign in for Android
1.Add the SignInButton in your application's layout:
<com.google.android.gms.common.SignInButton
android:id="@+id/sign_in_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
2.Initialize mPlusClient with the requested visible activities in your
Activity.onCreate handler:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mPlusClient = new PlusClient.Builder(this, this, this)
.setVisibleActivities("http://schemas.google.com/AddActivity",
"http://schemas.google.com/BuyActivity")
.build();
}
3.In the Android activity, register your button's OnClickListener to sign in the user when
clicked:
findViewById(R.id.sign_in_button).setOnClickListener(this);
Add the Google+ Sign-In button
4.You should start to resolve any connection errors held in mConnectionResult.
public void onClick(View view) {
if (view.getId() == R.id.sign_in_button && !mPlusClient.isConnected()) {
if (mConnectionResult == null) {
mConnectionProgressDialog.show();
} else {
try {
mConnectionResult.startResolutionForResult(this,
REQUEST_CODE_RESOLVE_ERR);
} catch (SendIntentException e) {
// Try connecting again.
mConnectionResult = null;
mPlusClient.connect();
}
}
}
}
5.When the user has successfully signed in, your onConnected handler will be called:
public void onConnected(Bundle connectionHint) {
mConnectionProgressDialog.dismiss();
Toast.makeText(this, "User is connected!", Toast.LENGTH_LONG).show();
}
Sign out the user
You can add a sign out button to your app. Create a button in your app to act as your
sign out button. Attach an onClickListener to the button and configure
the onClickmethod to disconnect the PlusClient:
public void onClick(View view) {
if (view.getId() == R.id.sign_out_button) {
if (mPlusClient.isConnected()) {
mPlusClient.clearDefaultAccount();
mPlusClient.disconnect();
mPlusClient.connect();
}
}
}
This code clears which account is connected to the app. To sign in again, the user
would choose their account again.
Revoking access tokens and disconnecting the
app
The following code shows a simple example of calling
the PlusClient.revokeAccessAndDisconnect method and responding to
the onAccessRevoked event:
// Prior to disconnecting, run clearDefaultAccount().
mPlusClient.clearDefaultAccount();
mPlusClient.revokeAccessAndDisconnect(new OnAccessRevokedListener() {
public void onAccessRevoked(ConnectionResult status) {
// mPlusClient is now disconnected and access has been revoked.
// Trigger app logic to comply with the developer policies
}
});
Customizing your sign-in button
If you require additional customization, you can define a custom button:
1.Review the branding guidelines and download icons and images to use in your
button.
2.Add the button to your application layout.
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="@string/common_signin_button_text_long" />
Localization
The SDK provides localized strings for the SignInButton
To view a full list of languages, you can examine the following directory in the
SDK: <android-sdk-folder>/extras/google/google_play_services/libproject/google-
play-services_lib/res/.
In that location, you will find directories named values-<langcode>.
Server-side access for your app
Bundle appActivities = new Bundle();
appActivities.putString(GoogleAuthUtil.KEY_REQUEST_VISIBLE_ACTIVITIES,
"<app-activity1> <app-activity2>");
String scopes = "oauth2:server:client_id:<server client-id>:api_scope:<scope1> <scope2>";
String code = null;
try {
code = GoogleAuthUtil.getToken(this, // Context context
mPlusClient.getAccountName(), // String accountName
scopes, // String scope
appActivities // Bundle bundle
);
} catch (IOException transientEx) {
// network or server error,
return;
} catch (UserRecoverableAuthException e) {
// Recover
code = null;
} catch (GoogleAuthException authEx) {
// Failure.
return;
} catch (Exception e) {
throw new RuntimeException(e);
}
String accessToken = null;
try {
accessToken = GoogleAuthUtil.getToken(this,
mPlusClient.getAccountName(),
"oauth2:" + TextUtils.join(' ', SCOPES));
} catch (IOException transientEx) {
// network or server error, the call is expected to succeed if you try again later.
// Don't attempt to call again immediately - the request is likely to
// fail, you'll hit quotas or back-off.
...
return;
} catch (UserRecoverableAuthException e) {
// Recover
accessToken = null;
} catch (GoogleAuthException authEx) {
// Failure. The call is not expected to ever succeed so it should not be
// retried.
return;
} catch (Exception e) {
throw new RuntimeException(e);
}
To learn more, see: + Android Authorization methods. + Cross client identity
References
The Google+ Platform
developers.google.com/+/
The Google+ Platform Channel on YouTube
goo.gl/NBnZIz
The Google+ Developers Blog
http://goo.gl/hAcBTO
Thank You
+Me
+GDG Algiers
+GDG Women Algiers

More Related Content

What's hot

Android Marshmallow APIs and Changes
Android Marshmallow APIs and ChangesAndroid Marshmallow APIs and Changes
Android Marshmallow APIs and ChangesMalwinder Singh
 
Vtiger Google Calendar Sync powers bi way synchronization between VTiger CRM ...
Vtiger Google Calendar Sync powers bi way synchronization between VTiger CRM ...Vtiger Google Calendar Sync powers bi way synchronization between VTiger CRM ...
Vtiger Google Calendar Sync powers bi way synchronization between VTiger CRM ...Smackcoders, Inc.
 
Обзор Android M
Обзор Android MОбзор Android M
Обзор Android MWOX APP
 
Exam 70-488 Developing Microsoft SharePoint Server 2013 Core Solutions Learni...
Exam 70-488 Developing Microsoft SharePoint Server 2013 Core Solutions Learni...Exam 70-488 Developing Microsoft SharePoint Server 2013 Core Solutions Learni...
Exam 70-488 Developing Microsoft SharePoint Server 2013 Core Solutions Learni...Mahmoud Hamed Mahmoud
 
How to use data binding in android
How to use data binding in androidHow to use data binding in android
How to use data binding in androidInnovationM
 
Fraudpointer - Google Apps integration
Fraudpointer  - Google Apps integrationFraudpointer  - Google Apps integration
Fraudpointer - Google Apps integrationFraudpointer.com
 
13 Steps to Safely Deprovision and Delete a Google Apps User
13 Steps to Safely Deprovision and Delete a Google Apps User13 Steps to Safely Deprovision and Delete a Google Apps User
13 Steps to Safely Deprovision and Delete a Google Apps UserDatto
 
Building Cloud-powered Mobile Apps
Building Cloud-powered Mobile AppsBuilding Cloud-powered Mobile Apps
Building Cloud-powered Mobile AppsDanilo Poccia
 
Bridging google analytics &amp; tag manager #melbseo meetup
Bridging google analytics &amp; tag manager #melbseo meetupBridging google analytics &amp; tag manager #melbseo meetup
Bridging google analytics &amp; tag manager #melbseo meetupDaniel Wild
 
AWS Webinar - 201 Developing mobile apps with AWS
AWS Webinar - 201 Developing mobile apps with AWSAWS Webinar - 201 Developing mobile apps with AWS
AWS Webinar - 201 Developing mobile apps with AWSAmazon Web Services
 

What's hot (15)

Chapter 11
Chapter 11Chapter 11
Chapter 11
 
Android Marshmallow APIs and Changes
Android Marshmallow APIs and ChangesAndroid Marshmallow APIs and Changes
Android Marshmallow APIs and Changes
 
Vtiger Google Calendar Sync powers bi way synchronization between VTiger CRM ...
Vtiger Google Calendar Sync powers bi way synchronization between VTiger CRM ...Vtiger Google Calendar Sync powers bi way synchronization between VTiger CRM ...
Vtiger Google Calendar Sync powers bi way synchronization between VTiger CRM ...
 
Обзор Android M
Обзор Android MОбзор Android M
Обзор Android M
 
Exam 70-488 Developing Microsoft SharePoint Server 2013 Core Solutions Learni...
Exam 70-488 Developing Microsoft SharePoint Server 2013 Core Solutions Learni...Exam 70-488 Developing Microsoft SharePoint Server 2013 Core Solutions Learni...
Exam 70-488 Developing Microsoft SharePoint Server 2013 Core Solutions Learni...
 
Building mobile apps on AWS
Building mobile apps on AWSBuilding mobile apps on AWS
Building mobile apps on AWS
 
How to use data binding in android
How to use data binding in androidHow to use data binding in android
How to use data binding in android
 
Fraudpointer - Google Apps integration
Fraudpointer  - Google Apps integrationFraudpointer  - Google Apps integration
Fraudpointer - Google Apps integration
 
13 Steps to Safely Deprovision and Delete a Google Apps User
13 Steps to Safely Deprovision and Delete a Google Apps User13 Steps to Safely Deprovision and Delete a Google Apps User
13 Steps to Safely Deprovision and Delete a Google Apps User
 
Building Cloud-powered Mobile Apps
Building Cloud-powered Mobile AppsBuilding Cloud-powered Mobile Apps
Building Cloud-powered Mobile Apps
 
OAuth2 and LinkedIn
OAuth2 and LinkedInOAuth2 and LinkedIn
OAuth2 and LinkedIn
 
Bridging google analytics &amp; tag manager #melbseo meetup
Bridging google analytics &amp; tag manager #melbseo meetupBridging google analytics &amp; tag manager #melbseo meetup
Bridging google analytics &amp; tag manager #melbseo meetup
 
Oauth 2.0
Oauth 2.0Oauth 2.0
Oauth 2.0
 
AWS Webinar - 201 Developing mobile apps with AWS
AWS Webinar - 201 Developing mobile apps with AWSAWS Webinar - 201 Developing mobile apps with AWS
AWS Webinar - 201 Developing mobile apps with AWS
 
Groovymag_May-2012
Groovymag_May-2012Groovymag_May-2012
Groovymag_May-2012
 

Viewers also liked

Introduction to Google API
Introduction to Google APIIntroduction to Google API
Introduction to Google APILakhdar Meftah
 
Agile france 2014 - Juste à temps
Agile france 2014 - Juste à tempsAgile france 2014 - Juste à temps
Agile france 2014 - Juste à tempsFrançois Wauquier
 
La fonction maintenance
La fonction maintenanceLa fonction maintenance
La fonction maintenanceLakhdar Meftah
 
13 rip.fm
13 rip.fm13 rip.fm
13 rip.fmazizing
 
Arduino Algiers MeetUp
Arduino Algiers MeetUpArduino Algiers MeetUp
Arduino Algiers MeetUpLakhdar Meftah
 

Viewers also liked (6)

Introduction to Google API
Introduction to Google APIIntroduction to Google API
Introduction to Google API
 
Agile france 2014 - Juste à temps
Agile france 2014 - Juste à tempsAgile france 2014 - Juste à temps
Agile france 2014 - Juste à temps
 
La fonction maintenance
La fonction maintenanceLa fonction maintenance
La fonction maintenance
 
13 rip.fm
13 rip.fm13 rip.fm
13 rip.fm
 
Arduino Algiers MeetUp
Arduino Algiers MeetUpArduino Algiers MeetUp
Arduino Algiers MeetUp
 
Présentation des IoT
Présentation des IoTPrésentation des IoT
Présentation des IoT
 

Similar to Google+ sign in for mobile & web apps

Google external login setup in ASP (1).pdf
Google external login setup in ASP  (1).pdfGoogle external login setup in ASP  (1).pdf
Google external login setup in ASP (1).pdffindandsolve .com
 
Android chat in the cloud
Android chat in the cloudAndroid chat in the cloud
Android chat in the cloudfirenze-gtug
 
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidMobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidAlberto Ruibal
 
Google+ for Mobile Apps on iOS and Android
Google+ for Mobile Apps on iOS and AndroidGoogle+ for Mobile Apps on iOS and Android
Google+ for Mobile Apps on iOS and AndroidPeter Friese
 
Google Analytics for Developers
Google Analytics for DevelopersGoogle Analytics for Developers
Google Analytics for DevelopersRubén Martínez
 
Introduction to the Salesforce Mobile SDK for Android
Introduction to the Salesforce Mobile SDK for AndroidIntroduction to the Salesforce Mobile SDK for Android
Introduction to the Salesforce Mobile SDK for AndroidSalesforce Developers
 
Google Analytics for Developers
Google Analytics for DevelopersGoogle Analytics for Developers
Google Analytics for DevelopersParadigma Digital
 
Implementing cast in android
Implementing cast in androidImplementing cast in android
Implementing cast in androidAngelo Rüggeberg
 
(MBL310) Workshop: Build iOS Apps Using AWS Mobile Services | AWS re:Invent 2014
(MBL310) Workshop: Build iOS Apps Using AWS Mobile Services | AWS re:Invent 2014(MBL310) Workshop: Build iOS Apps Using AWS Mobile Services | AWS re:Invent 2014
(MBL310) Workshop: Build iOS Apps Using AWS Mobile Services | AWS re:Invent 2014Amazon Web Services
 
Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]Sittiphol Phanvilai
 
iOS & Android App Indexing & App Actions
iOS & Android App Indexing & App ActionsiOS & Android App Indexing & App Actions
iOS & Android App Indexing & App ActionsJustin Briggs
 
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015MobileMoxie
 
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015Suzzicks
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android AppsGil Irizarry
 
Android Quiz App – Test Your IQ.pdf
Android Quiz App – Test Your IQ.pdfAndroid Quiz App – Test Your IQ.pdf
Android Quiz App – Test Your IQ.pdfSudhanshiBakre1
 
Cross-Platform Authentication with Google+ Sign-In
Cross-Platform Authentication with Google+ Sign-InCross-Platform Authentication with Google+ Sign-In
Cross-Platform Authentication with Google+ Sign-InPeter Friese
 
Introduction to Visualforce for Mobile Devices
Introduction to Visualforce for Mobile DevicesIntroduction to Visualforce for Mobile Devices
Introduction to Visualforce for Mobile DevicesSalesforce Developers
 
Introduction to Android Programming
Introduction to Android ProgrammingIntroduction to Android Programming
Introduction to Android ProgrammingRaveendra R
 
Angular 11 google social login or sign in tutorial using angularx social-login
Angular 11 google social login or sign in tutorial using angularx social-loginAngular 11 google social login or sign in tutorial using angularx social-login
Angular 11 google social login or sign in tutorial using angularx social-loginKaty Slemon
 

Similar to Google+ sign in for mobile & web apps (20)

Google external login setup in ASP (1).pdf
Google external login setup in ASP  (1).pdfGoogle external login setup in ASP  (1).pdf
Google external login setup in ASP (1).pdf
 
Android chat in the cloud
Android chat in the cloudAndroid chat in the cloud
Android chat in the cloud
 
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on AndroidMobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
Mobile 2.0 Open Ideas WorkShop: Building Social Media Enabled Apps on Android
 
Google+ for Mobile Apps on iOS and Android
Google+ for Mobile Apps on iOS and AndroidGoogle+ for Mobile Apps on iOS and Android
Google+ for Mobile Apps on iOS and Android
 
Google Analytics for Developers
Google Analytics for DevelopersGoogle Analytics for Developers
Google Analytics for Developers
 
Introduction to the Salesforce Mobile SDK for Android
Introduction to the Salesforce Mobile SDK for AndroidIntroduction to the Salesforce Mobile SDK for Android
Introduction to the Salesforce Mobile SDK for Android
 
Google Analytics for Developers
Google Analytics for DevelopersGoogle Analytics for Developers
Google Analytics for Developers
 
Implementing cast in android
Implementing cast in androidImplementing cast in android
Implementing cast in android
 
(MBL310) Workshop: Build iOS Apps Using AWS Mobile Services | AWS re:Invent 2014
(MBL310) Workshop: Build iOS Apps Using AWS Mobile Services | AWS re:Invent 2014(MBL310) Workshop: Build iOS Apps Using AWS Mobile Services | AWS re:Invent 2014
(MBL310) Workshop: Build iOS Apps Using AWS Mobile Services | AWS re:Invent 2014
 
Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]
 
iOS & Android App Indexing & App Actions
iOS & Android App Indexing & App ActionsiOS & Android App Indexing & App Actions
iOS & Android App Indexing & App Actions
 
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
 
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
 
Android Quiz App – Test Your IQ.pdf
Android Quiz App – Test Your IQ.pdfAndroid Quiz App – Test Your IQ.pdf
Android Quiz App – Test Your IQ.pdf
 
Cross-Platform Authentication with Google+ Sign-In
Cross-Platform Authentication with Google+ Sign-InCross-Platform Authentication with Google+ Sign-In
Cross-Platform Authentication with Google+ Sign-In
 
Introduction to Visualforce for Mobile Devices
Introduction to Visualforce for Mobile DevicesIntroduction to Visualforce for Mobile Devices
Introduction to Visualforce for Mobile Devices
 
Introduction to Android Programming
Introduction to Android ProgrammingIntroduction to Android Programming
Introduction to Android Programming
 
Building mobile apps on aws
Building mobile apps on awsBuilding mobile apps on aws
Building mobile apps on aws
 
Angular 11 google social login or sign in tutorial using angularx social-login
Angular 11 google social login or sign in tutorial using angularx social-loginAngular 11 google social login or sign in tutorial using angularx social-login
Angular 11 google social login or sign in tutorial using angularx social-login
 

Recently uploaded

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

Google+ sign in for mobile & web apps

  • 1. Google+ Sign-in for Mobile and Web By +Lakhdar Meftah
  • 2. Simple, secure authentication Interactive posts Over-the-air installs Integrated Hangouts Profile & social graph access Lasting re- engagement Engagement analytics Google+ plugins
  • 3. Google+ Sign-In Simple, secure authentication Build on a trusted relationship Works with your existing sign-in systems Cross-platform single sign on Avoid the hassle of creating your own authentication system Learn more about your users and their friend Give users more choice
  • 4. Interactive Posts Stand out in the stream Drive action Customize the post Measure impact Interactive post flow Pull people into your app to take specific actions
  • 5. Over-The-Air Installs Stay connected to users across their devices Drive automatic Android downloads from your website sign-ins One-step download to a user's device Measure your downloads
  • 6. Google+ Hangouts: Some things are better face to face
  • 7. App Customization Customize content and suggest connections for your users Improve engagement through users' connections Create accurate profiles Connect friends Spark content discovery Create dynamic marketing campaigns
  • 8. App Activities Increase app discovery and drive lasting re-engagement Build conversations and share activities that matter App activities in Google Search Be found on user's Google+ profile
  • 9. Google+ Platform Insights Meaningful analytics to optimize your integration Get the most out of Google+ Sign-In Understand your users Dig deeper into post performance Optimize your integration based on user activity Monitor installs to your Android app
  • 10. Plugins Grow your audience through identity, relationships, and sharing. +1 button Badge Recommendations Share Follow button Snippest
  • 12. 1. Enable the Google+ API 2. Configure your Eclipse project 3. Run the Google+ sample app 4. Initialize the PlusClient 1. Create a Google APIs Console project .
  • 13. 1.Add the Google+ Sign-In button to your app 2.Sign out the user 3.Revoking access tokens and disconnecting the app 4.Customizing your sign-in button 5.Localization 6.Server-side access for your app 2. Google+ Sign in for Android
  • 14. 1.Add the SignInButton in your application's layout: <com.google.android.gms.common.SignInButton android:id="@+id/sign_in_button" android:layout_width="wrap_content" android:layout_height="wrap_content" /> 2.Initialize mPlusClient with the requested visible activities in your Activity.onCreate handler: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mPlusClient = new PlusClient.Builder(this, this, this) .setVisibleActivities("http://schemas.google.com/AddActivity", "http://schemas.google.com/BuyActivity") .build(); } 3.In the Android activity, register your button's OnClickListener to sign in the user when clicked: findViewById(R.id.sign_in_button).setOnClickListener(this); Add the Google+ Sign-In button
  • 15. 4.You should start to resolve any connection errors held in mConnectionResult. public void onClick(View view) { if (view.getId() == R.id.sign_in_button && !mPlusClient.isConnected()) { if (mConnectionResult == null) { mConnectionProgressDialog.show(); } else { try { mConnectionResult.startResolutionForResult(this, REQUEST_CODE_RESOLVE_ERR); } catch (SendIntentException e) { // Try connecting again. mConnectionResult = null; mPlusClient.connect(); } } } } 5.When the user has successfully signed in, your onConnected handler will be called: public void onConnected(Bundle connectionHint) { mConnectionProgressDialog.dismiss(); Toast.makeText(this, "User is connected!", Toast.LENGTH_LONG).show(); }
  • 16. Sign out the user You can add a sign out button to your app. Create a button in your app to act as your sign out button. Attach an onClickListener to the button and configure the onClickmethod to disconnect the PlusClient: public void onClick(View view) { if (view.getId() == R.id.sign_out_button) { if (mPlusClient.isConnected()) { mPlusClient.clearDefaultAccount(); mPlusClient.disconnect(); mPlusClient.connect(); } } } This code clears which account is connected to the app. To sign in again, the user would choose their account again.
  • 17. Revoking access tokens and disconnecting the app The following code shows a simple example of calling the PlusClient.revokeAccessAndDisconnect method and responding to the onAccessRevoked event: // Prior to disconnecting, run clearDefaultAccount(). mPlusClient.clearDefaultAccount(); mPlusClient.revokeAccessAndDisconnect(new OnAccessRevokedListener() { public void onAccessRevoked(ConnectionResult status) { // mPlusClient is now disconnected and access has been revoked. // Trigger app logic to comply with the developer policies } });
  • 18. Customizing your sign-in button If you require additional customization, you can define a custom button: 1.Review the branding guidelines and download icons and images to use in your button. 2.Add the button to your application layout. <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:text="@string/common_signin_button_text_long" /> Localization The SDK provides localized strings for the SignInButton To view a full list of languages, you can examine the following directory in the SDK: <android-sdk-folder>/extras/google/google_play_services/libproject/google- play-services_lib/res/. In that location, you will find directories named values-<langcode>.
  • 19. Server-side access for your app Bundle appActivities = new Bundle(); appActivities.putString(GoogleAuthUtil.KEY_REQUEST_VISIBLE_ACTIVITIES, "<app-activity1> <app-activity2>"); String scopes = "oauth2:server:client_id:<server client-id>:api_scope:<scope1> <scope2>"; String code = null; try { code = GoogleAuthUtil.getToken(this, // Context context mPlusClient.getAccountName(), // String accountName scopes, // String scope appActivities // Bundle bundle ); } catch (IOException transientEx) { // network or server error, return; } catch (UserRecoverableAuthException e) { // Recover code = null; } catch (GoogleAuthException authEx) { // Failure. return; } catch (Exception e) { throw new RuntimeException(e); }
  • 20. String accessToken = null; try { accessToken = GoogleAuthUtil.getToken(this, mPlusClient.getAccountName(), "oauth2:" + TextUtils.join(' ', SCOPES)); } catch (IOException transientEx) { // network or server error, the call is expected to succeed if you try again later. // Don't attempt to call again immediately - the request is likely to // fail, you'll hit quotas or back-off. ... return; } catch (UserRecoverableAuthException e) { // Recover accessToken = null; } catch (GoogleAuthException authEx) { // Failure. The call is not expected to ever succeed so it should not be // retried. return; } catch (Exception e) { throw new RuntimeException(e); } To learn more, see: + Android Authorization methods. + Cross client identity
  • 21. References The Google+ Platform developers.google.com/+/ The Google+ Platform Channel on YouTube goo.gl/NBnZIz The Google+ Developers Blog http://goo.gl/hAcBTO