SlideShare a Scribd company logo
1 of 17
Download to read offline
Creating an Uber Clone - Part XXXIII
We already prepared a lot of the groundwork for social login on the server but didn't finish all the pieces so before I step into the client side changes needed for social
login lets discuss some of the required server side work.
public boolean existsByFacebook(String fb) {
List<User> us = users.findByFacebookId(fb);
return !us.isEmpty();
}
public boolean existsByGoogle(String google) {
List<User> us = users.findByGoogleId(google);
return !us.isEmpty();
}
UserService (Server)
I had to include support for the exists functionality that works based on a social token
@RequestMapping(method=RequestMethod.GET,value = "/exists")
public @ResponseBody boolean exists(String v) {
return users.existsByPhone(v);
}
@RequestMapping(method=RequestMethod.GET,value = "/existsFacebook")
public @ResponseBody boolean existsFacebook(String v) {
return users.existsByFacebook(v);
}
@RequestMapping(method=RequestMethod.GET,value = "/existsGoogle")
public @ResponseBody boolean existsGoogle(String v) {
return users.existsByGoogle(v);
}
UserWebservice
I also had to include a similar call in the UserWebservice class. I also have a smaller subtle change to the regular exists method. The argument name was phone and is
now v which means I can invoke all 3 webservices with very similar code on the client side.

That's it, pretty much everything else was already done.
Social Login
✦Seamless: Low Friction Sign-in
✦Native support or social app will be used when
available
✦When unavailable we’ll see a web based login
✦If we are on the simulator we will fallback to an OAuth
based login
✦Driver & User Apps - we’ll need to do each step twice!
© Codename One 2017 all rights reserved
Social login lets us authenticate a user without getting into the username/password complexity. This is usually almost seamless on devices where the preinstalled social
app is invoked explicitly and the user just needs to "approve the permissions”. 

This is defined as a "low friction" approach to authenticate the user and is often superior to phone number activation. In Codename One this is pretty trivial to accomplish
especially for Google & Facebook login both of which are builtin to Codename One and into Android/iOS respectively.

Connection to social networks in Codename One has several common concepts. If the device has native support or the social app installed this native integration will
perform a login

If it doesn't but we are on the device the native SDK will show a web based login

If we are on the simulator we will fallback to an OAuth based login. This leads to a situation where login might work on one device but fail on the simulator or fail on a
different device type. It also makes the configuration process a bit more tedious. To be fair the native configuration is MUCH harder and involves more code.

Since the driver app is physically a separate app we’ll need to redo some of the steps and effectively go through everything twice
Facebook
© Codename One 2017 all rights reserved
https://developers.facebook.com/apps/
A core concept of the login process in Facebook is the "app" which is a Facebook internal term unrelated to your actual app. Facebooks view of an app is anything that
uses the Facebook graph API and authentication. In this case we need to create a new app and should name it like we do our actual app so the user will be able to
identify it.

The steps are pretty easy we navigate to https://developers.facebook.com/apps/ and press the Add a new app button.
Facebook
© Codename One 2017 all rights reserved
Next we need to select the product we are trying to use and we need to select Facebook login. Once there we are presented with a wizard containing multiple steps to
set up your app.
Facebook
© Codename One 2017 all rights reserved
You need to run through the wizard twice. Once for iOS and once for Android.
Facebook iOS Wizard
© Codename One 2017 all rights reserved
The content of the wizard changes but the gist is the same, we don't really need much information and can skip almost everything...

The first step is download and Install the Facebook SDK for iOS. This is obviously unnecessary for us so we can just press next
Facebook iOS Wizard
© Codename One 2017 all rights reserved
The second step is add Login Kit to your Xcode Project. Again there is no need to do anything and we can press next
Facebook iOS Wizard
© Codename One 2017 all rights reserved
The third step is Add your Bundle Identifier. It’s more interesting. We need to enter the project package name here and press Save then we are effectively done with iOS
as everything else is more of the same…
keytool -exportcert -alias YOUR_RELEASE_KEY_ALIAS
-keystore YOUR_RELEASE_KEY_PATH
| openssl sha1 -binary | openssl base64
Facebook Android Wizard
The Android wizard has one task that is a bit challenging but other than that it should be trivial.

Before we begin we need to generate key hashes for facebook which need to be done on your development machine. To do that you will need a command line with the
JDK's bin directory in your path. You will also need the path to the Android keystore you use for signing. You can find this file in the Android signing section in Codename
One Settings. If there is no certificate file there make sure to generate it.

Once all of this is in place you can use this command for Linux/Mac. This will provide the SHA1 key you will need in the Android wizard.
keytool -exportcert -alias androiddebugkey -keystore
"C:UsersUSERNAME.androiddebug.keystore" |
"PATH_TO_OPENSSL_LIBRARYbinopenssl" sha1 -binary |
"PATH_TO_OPENSSL_LIBRARYbinopenssl" base64
Facebook Android Wizard
Similarly on windows the command follows a similar structure but uses Windows command line conventions. Now that this is out of the way lets go over the Android
wizard steps
Facebook Android Wizard
© Codename One 2017 all rights reserved
The first step is download the Facebook SDK for Android. This is obviously unnecessary for us so we can just press Next
Facebook Android Wizard
© Codename One 2017 all rights reserved
The next step is import the Facebook SDK. Again there is no need to do anything and we can press Next
Facebook Android Wizard
© Codename One 2017 all rights reserved
The next step is tell Us about Your Android Project - We need to specify the package name for the application which in our case is com.codename1.apps.uberclone we
also need to specify the main class which is UberCN1Stub. The main class is effectively the main class name with the word “Stub" with an uppercase S appended at the
end. We can then press next.

After I pressed next I got this warning because the app isn’t in the store yet. Facebook thinks I might have typed the package incorrectly and provides this warning which
we can ignore
Facebook Android Wizard
© Codename One 2017 all rights reserved
And finally we are at the Add Your Development and Release Key Hashes. Here we need to add the hash we got before and press Next. The rest of the wizard isn’t
important…
Facebook Dashboard
© Codename One 2017 all rights reserved
Before we proceed we need to enter the facebook dashboard and copy two values. The app id and app secret which we will need when we setup the code

More Related Content

Similar to Creating an Uber Clone - Part XXXIII - Transcript.pdf

Creating and Deploying a Bot Service Using the Bot Framework and Visual Studio
Creating and Deploying a Bot Service Using the Bot Framework and  Visual StudioCreating and Deploying a Bot Service Using the Bot Framework and  Visual Studio
Creating and Deploying a Bot Service Using the Bot Framework and Visual StudioMurray Fife
 
Creating a Facebook Clone - Part I - Transcript.pdf
Creating a Facebook Clone - Part I - Transcript.pdfCreating a Facebook Clone - Part I - Transcript.pdf
Creating a Facebook Clone - Part I - Transcript.pdfShaiAlmog1
 
Facebook SSO.docx
Facebook SSO.docxFacebook SSO.docx
Facebook SSO.docxehathis
 
How NOT to Suck at App Distribution - Quick Start Guide - Appsocially's Growt...
How NOT to Suck at App Distribution - Quick Start Guide - Appsocially's Growt...How NOT to Suck at App Distribution - Quick Start Guide - Appsocially's Growt...
How NOT to Suck at App Distribution - Quick Start Guide - Appsocially's Growt...Yusuke Takahashi, PhD
 
Leynard quizon work portfolio (2012 to 2014)
Leynard quizon work portfolio (2012 to 2014)Leynard quizon work portfolio (2012 to 2014)
Leynard quizon work portfolio (2012 to 2014)Leynard Quizon
 
[not edited] Demo on mobile app development using ionic framework
[not edited] Demo on mobile app development using ionic framework[not edited] Demo on mobile app development using ionic framework
[not edited] Demo on mobile app development using ionic frameworkSayed Ahmed
 
Creating a Facebook Clone - Part II - Transcript.pdf
Creating a Facebook Clone - Part II - Transcript.pdfCreating a Facebook Clone - Part II - Transcript.pdf
Creating a Facebook Clone - Part II - Transcript.pdfShaiAlmog1
 
Introduction to Facebook JavaScript & Python SDK
Introduction to Facebook JavaScript & Python SDKIntroduction to Facebook JavaScript & Python SDK
Introduction to Facebook JavaScript & Python SDKColin Su
 
Azure slots for app deployment the continuous delivery way
Azure slots for app deployment the continuous delivery wayAzure slots for app deployment the continuous delivery way
Azure slots for app deployment the continuous delivery waywale ayandiran
 
Introduction to Docker and Containers- Learning Simple
Introduction to Docker and Containers- Learning SimpleIntroduction to Docker and Containers- Learning Simple
Introduction to Docker and Containers- Learning SimpleSandeep Hijam
 
How do I - Use Include Source to debug native code - Trasnscript.pdf
How do I - Use Include Source to debug native code - Trasnscript.pdfHow do I - Use Include Source to debug native code - Trasnscript.pdf
How do I - Use Include Source to debug native code - Trasnscript.pdfShaiAlmog1
 
MoodLocator HwT
MoodLocator HwTMoodLocator HwT
MoodLocator HwTJDihlmann
 
iOS App Distribution Tactics – What If I Don’t Want to Use App Store_.pdf
iOS App Distribution Tactics – What If I Don’t Want to Use App Store_.pdfiOS App Distribution Tactics – What If I Don’t Want to Use App Store_.pdf
iOS App Distribution Tactics – What If I Don’t Want to Use App Store_.pdfSmith Daniel
 

Similar to Creating an Uber Clone - Part XXXIII - Transcript.pdf (20)

How to build your own Android App -Step by Step Guide
How to build your own Android App -Step by Step GuideHow to build your own Android App -Step by Step Guide
How to build your own Android App -Step by Step Guide
 
Creating and Deploying a Bot Service Using the Bot Framework and Visual Studio
Creating and Deploying a Bot Service Using the Bot Framework and  Visual StudioCreating and Deploying a Bot Service Using the Bot Framework and  Visual Studio
Creating and Deploying a Bot Service Using the Bot Framework and Visual Studio
 
Creating a Facebook Clone - Part I - Transcript.pdf
Creating a Facebook Clone - Part I - Transcript.pdfCreating a Facebook Clone - Part I - Transcript.pdf
Creating a Facebook Clone - Part I - Transcript.pdf
 
Facebook SSO.docx
Facebook SSO.docxFacebook SSO.docx
Facebook SSO.docx
 
Android app development guide for freshers by ace web academy
Android app development guide for freshers  by ace web academyAndroid app development guide for freshers  by ace web academy
Android app development guide for freshers by ace web academy
 
How NOT to Suck at App Distribution - Quick Start Guide - Appsocially's Growt...
How NOT to Suck at App Distribution - Quick Start Guide - Appsocially's Growt...How NOT to Suck at App Distribution - Quick Start Guide - Appsocially's Growt...
How NOT to Suck at App Distribution - Quick Start Guide - Appsocially's Growt...
 
Leynard quizon work portfolio (2012 to 2014)
Leynard quizon work portfolio (2012 to 2014)Leynard quizon work portfolio (2012 to 2014)
Leynard quizon work portfolio (2012 to 2014)
 
[not edited] Demo on mobile app development using ionic framework
[not edited] Demo on mobile app development using ionic framework[not edited] Demo on mobile app development using ionic framework
[not edited] Demo on mobile app development using ionic framework
 
Creating a Facebook Clone - Part II - Transcript.pdf
Creating a Facebook Clone - Part II - Transcript.pdfCreating a Facebook Clone - Part II - Transcript.pdf
Creating a Facebook Clone - Part II - Transcript.pdf
 
Build apps for slack
Build apps for slackBuild apps for slack
Build apps for slack
 
Appium_set_up
Appium_set_upAppium_set_up
Appium_set_up
 
Introduction to Facebook JavaScript & Python SDK
Introduction to Facebook JavaScript & Python SDKIntroduction to Facebook JavaScript & Python SDK
Introduction to Facebook JavaScript & Python SDK
 
Azure slots for app deployment the continuous delivery way
Azure slots for app deployment the continuous delivery wayAzure slots for app deployment the continuous delivery way
Azure slots for app deployment the continuous delivery way
 
Introduction to Docker and Containers- Learning Simple
Introduction to Docker and Containers- Learning SimpleIntroduction to Docker and Containers- Learning Simple
Introduction to Docker and Containers- Learning Simple
 
CI & CD- mobile application
CI & CD- mobile applicationCI & CD- mobile application
CI & CD- mobile application
 
CI & CD- mobile application
CI & CD- mobile applicationCI & CD- mobile application
CI & CD- mobile application
 
How do I - Use Include Source to debug native code - Trasnscript.pdf
How do I - Use Include Source to debug native code - Trasnscript.pdfHow do I - Use Include Source to debug native code - Trasnscript.pdf
How do I - Use Include Source to debug native code - Trasnscript.pdf
 
MoodLocator HwT
MoodLocator HwTMoodLocator HwT
MoodLocator HwT
 
iOS App Distribution Tactics – What If I Don’t Want to Use App Store_.pdf
iOS App Distribution Tactics – What If I Don’t Want to Use App Store_.pdfiOS App Distribution Tactics – What If I Don’t Want to Use App Store_.pdf
iOS App Distribution Tactics – What If I Don’t Want to Use App Store_.pdf
 
Wordpress as a framework
Wordpress as a frameworkWordpress as a framework
Wordpress as a framework
 

More from ShaiAlmog1

The Duck Teaches Learn to debug from the masters. Local to production- kill ...
The Duck Teaches  Learn to debug from the masters. Local to production- kill ...The Duck Teaches  Learn to debug from the masters. Local to production- kill ...
The Duck Teaches Learn to debug from the masters. Local to production- kill ...ShaiAlmog1
 
create-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdfcreate-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdfShaiAlmog1
 
create-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdfcreate-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdfShaiAlmog1
 
create-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdfcreate-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdfShaiAlmog1
 
create-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdfcreate-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdfShaiAlmog1
 
create-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdfcreate-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdfShaiAlmog1
 
create-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdfcreate-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdfShaiAlmog1
 
create-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdfcreate-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdfShaiAlmog1
 
create-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdfcreate-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdfShaiAlmog1
 
create-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdfcreate-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdfShaiAlmog1
 
create-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdfcreate-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdfShaiAlmog1
 
create-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdfcreate-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdfShaiAlmog1
 
create-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdfcreate-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdfCreating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdfCreating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfCreating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdfCreating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdfCreating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdfCreating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdfShaiAlmog1
 
Creating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdfCreating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdfShaiAlmog1
 

More from ShaiAlmog1 (20)

The Duck Teaches Learn to debug from the masters. Local to production- kill ...
The Duck Teaches  Learn to debug from the masters. Local to production- kill ...The Duck Teaches  Learn to debug from the masters. Local to production- kill ...
The Duck Teaches Learn to debug from the masters. Local to production- kill ...
 
create-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdfcreate-netflix-clone-06-client-ui.pdf
create-netflix-clone-06-client-ui.pdf
 
create-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdfcreate-netflix-clone-01-introduction_transcript.pdf
create-netflix-clone-01-introduction_transcript.pdf
 
create-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdfcreate-netflix-clone-02-server_transcript.pdf
create-netflix-clone-02-server_transcript.pdf
 
create-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdfcreate-netflix-clone-04-server-continued_transcript.pdf
create-netflix-clone-04-server-continued_transcript.pdf
 
create-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdfcreate-netflix-clone-01-introduction.pdf
create-netflix-clone-01-introduction.pdf
 
create-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdfcreate-netflix-clone-06-client-ui_transcript.pdf
create-netflix-clone-06-client-ui_transcript.pdf
 
create-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdfcreate-netflix-clone-03-server.pdf
create-netflix-clone-03-server.pdf
 
create-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdfcreate-netflix-clone-04-server-continued.pdf
create-netflix-clone-04-server-continued.pdf
 
create-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdfcreate-netflix-clone-05-client-model_transcript.pdf
create-netflix-clone-05-client-model_transcript.pdf
 
create-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdfcreate-netflix-clone-03-server_transcript.pdf
create-netflix-clone-03-server_transcript.pdf
 
create-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdfcreate-netflix-clone-02-server.pdf
create-netflix-clone-02-server.pdf
 
create-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdfcreate-netflix-clone-05-client-model.pdf
create-netflix-clone-05-client-model.pdf
 
Creating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdfCreating a Whatsapp Clone - Part II.pdf
Creating a Whatsapp Clone - Part II.pdf
 
Creating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdfCreating a Whatsapp Clone - Part IX - Transcript.pdf
Creating a Whatsapp Clone - Part IX - Transcript.pdf
 
Creating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdfCreating a Whatsapp Clone - Part II - Transcript.pdf
Creating a Whatsapp Clone - Part II - Transcript.pdf
 
Creating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdfCreating a Whatsapp Clone - Part V - Transcript.pdf
Creating a Whatsapp Clone - Part V - Transcript.pdf
 
Creating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdfCreating a Whatsapp Clone - Part IV - Transcript.pdf
Creating a Whatsapp Clone - Part IV - Transcript.pdf
 
Creating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdfCreating a Whatsapp Clone - Part IV.pdf
Creating a Whatsapp Clone - Part IV.pdf
 
Creating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdfCreating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdf
 

Recently uploaded

New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 

Recently uploaded (20)

New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 

Creating an Uber Clone - Part XXXIII - Transcript.pdf

  • 1. Creating an Uber Clone - Part XXXIII We already prepared a lot of the groundwork for social login on the server but didn't finish all the pieces so before I step into the client side changes needed for social login lets discuss some of the required server side work.
  • 2. public boolean existsByFacebook(String fb) { List<User> us = users.findByFacebookId(fb); return !us.isEmpty(); } public boolean existsByGoogle(String google) { List<User> us = users.findByGoogleId(google); return !us.isEmpty(); } UserService (Server) I had to include support for the exists functionality that works based on a social token
  • 3. @RequestMapping(method=RequestMethod.GET,value = "/exists") public @ResponseBody boolean exists(String v) { return users.existsByPhone(v); } @RequestMapping(method=RequestMethod.GET,value = "/existsFacebook") public @ResponseBody boolean existsFacebook(String v) { return users.existsByFacebook(v); } @RequestMapping(method=RequestMethod.GET,value = "/existsGoogle") public @ResponseBody boolean existsGoogle(String v) { return users.existsByGoogle(v); } UserWebservice I also had to include a similar call in the UserWebservice class. I also have a smaller subtle change to the regular exists method. The argument name was phone and is now v which means I can invoke all 3 webservices with very similar code on the client side. That's it, pretty much everything else was already done.
  • 4. Social Login ✦Seamless: Low Friction Sign-in ✦Native support or social app will be used when available ✦When unavailable we’ll see a web based login ✦If we are on the simulator we will fallback to an OAuth based login ✦Driver & User Apps - we’ll need to do each step twice! © Codename One 2017 all rights reserved Social login lets us authenticate a user without getting into the username/password complexity. This is usually almost seamless on devices where the preinstalled social app is invoked explicitly and the user just needs to "approve the permissions”. This is defined as a "low friction" approach to authenticate the user and is often superior to phone number activation. In Codename One this is pretty trivial to accomplish especially for Google & Facebook login both of which are builtin to Codename One and into Android/iOS respectively. Connection to social networks in Codename One has several common concepts. If the device has native support or the social app installed this native integration will perform a login If it doesn't but we are on the device the native SDK will show a web based login If we are on the simulator we will fallback to an OAuth based login. This leads to a situation where login might work on one device but fail on the simulator or fail on a different device type. It also makes the configuration process a bit more tedious. To be fair the native configuration is MUCH harder and involves more code. Since the driver app is physically a separate app we’ll need to redo some of the steps and effectively go through everything twice
  • 5. Facebook © Codename One 2017 all rights reserved https://developers.facebook.com/apps/ A core concept of the login process in Facebook is the "app" which is a Facebook internal term unrelated to your actual app. Facebooks view of an app is anything that uses the Facebook graph API and authentication. In this case we need to create a new app and should name it like we do our actual app so the user will be able to identify it. The steps are pretty easy we navigate to https://developers.facebook.com/apps/ and press the Add a new app button.
  • 6. Facebook © Codename One 2017 all rights reserved Next we need to select the product we are trying to use and we need to select Facebook login. Once there we are presented with a wizard containing multiple steps to set up your app.
  • 7. Facebook © Codename One 2017 all rights reserved You need to run through the wizard twice. Once for iOS and once for Android.
  • 8. Facebook iOS Wizard © Codename One 2017 all rights reserved The content of the wizard changes but the gist is the same, we don't really need much information and can skip almost everything... The first step is download and Install the Facebook SDK for iOS. This is obviously unnecessary for us so we can just press next
  • 9. Facebook iOS Wizard © Codename One 2017 all rights reserved The second step is add Login Kit to your Xcode Project. Again there is no need to do anything and we can press next
  • 10. Facebook iOS Wizard © Codename One 2017 all rights reserved The third step is Add your Bundle Identifier. It’s more interesting. We need to enter the project package name here and press Save then we are effectively done with iOS as everything else is more of the same…
  • 11. keytool -exportcert -alias YOUR_RELEASE_KEY_ALIAS -keystore YOUR_RELEASE_KEY_PATH | openssl sha1 -binary | openssl base64 Facebook Android Wizard The Android wizard has one task that is a bit challenging but other than that it should be trivial. Before we begin we need to generate key hashes for facebook which need to be done on your development machine. To do that you will need a command line with the JDK's bin directory in your path. You will also need the path to the Android keystore you use for signing. You can find this file in the Android signing section in Codename One Settings. If there is no certificate file there make sure to generate it. Once all of this is in place you can use this command for Linux/Mac. This will provide the SHA1 key you will need in the Android wizard.
  • 12. keytool -exportcert -alias androiddebugkey -keystore "C:UsersUSERNAME.androiddebug.keystore" | "PATH_TO_OPENSSL_LIBRARYbinopenssl" sha1 -binary | "PATH_TO_OPENSSL_LIBRARYbinopenssl" base64 Facebook Android Wizard Similarly on windows the command follows a similar structure but uses Windows command line conventions. Now that this is out of the way lets go over the Android wizard steps
  • 13. Facebook Android Wizard © Codename One 2017 all rights reserved The first step is download the Facebook SDK for Android. This is obviously unnecessary for us so we can just press Next
  • 14. Facebook Android Wizard © Codename One 2017 all rights reserved The next step is import the Facebook SDK. Again there is no need to do anything and we can press Next
  • 15. Facebook Android Wizard © Codename One 2017 all rights reserved The next step is tell Us about Your Android Project - We need to specify the package name for the application which in our case is com.codename1.apps.uberclone we also need to specify the main class which is UberCN1Stub. The main class is effectively the main class name with the word “Stub" with an uppercase S appended at the end. We can then press next. After I pressed next I got this warning because the app isn’t in the store yet. Facebook thinks I might have typed the package incorrectly and provides this warning which we can ignore
  • 16. Facebook Android Wizard © Codename One 2017 all rights reserved And finally we are at the Add Your Development and Release Key Hashes. Here we need to add the hash we got before and press Next. The rest of the wizard isn’t important…
  • 17. Facebook Dashboard © Codename One 2017 all rights reserved Before we proceed we need to enter the facebook dashboard and copy two values. The app id and app secret which we will need when we setup the code