SlideShare a Scribd company logo
1 of 38
Download to read offline
Kobkrit Viriyayudhakorn, Ph.D.
kobkrit@gmail.com
http://www.kobkrit.com
Completing Chat Room App
Understand Firebase Pricing
Very Easy

to Fake an user.
• This is bad.
• We need something to check authority of the
chatter.
• We need a serious and professional chat app for
serious things.
• Let’s do the authentication.
Firebase Authentication
• Firebase Authentication provides backend services, easy-to-use
SDKs, and ready-made UI libraries to authenticate users to your
app.
• API: https://firebase.google.com/docs/reference/js/
firebase.auth.Auth
• It supports authentication using
• Passwords
• Federated Identity Providers
• Google, Facebook, Twitter, and Github.
Enable Sign-in Method
Enable E-mail Password
Create New Project and
Install Firebase
• We will install Firebase
• Open Terminal and change to a working directory
• $|> create-react-native-app firebase2
• $|> cd firebase2
• $|> npm install firebase moment --save
• $|> atom .
Code From Previous Lecture
• http://bit.ly/2zGjgfI
Adding Firebase
Authentication to Chat App
1.js
1.js
• Firebase gives us a reactive method for listening for
authentication. That is we can set up a listener to call a method
when the user logs in and out.
• When user is logout, the login modal will be shown up and reset
the name back to the “Anonymous”
• When user is login, the name text label at the header of the app is
changed.
1.js
• To sign a user in with their email and password, use the
signInWithEmailAndPassword() function. It accepts two
parameters, the user's email and password.
• After user successfully login, it will hide the login modal, and
trigger the onAuthStateChanged() [in the previous slide] to
change the name.
• If login failed, it will show alert popup with the error message.
1.js
• We can create a user by calling the
createUserWithEmailAndPassword() function. It accepts two
parameters, an email and a password.
• After an user successfully created, it will hide the login modal,
and trigger the onAuthStateChanged() [in the previous 2 slides]
to change the name.
• If register failed, it will show alert popup with the error message.
1.js
• To sign the current user out, use the signOut() method. It accepts no
parameters
• After an user successfully sign out, it will trigger the
onAuthStateChanged() [in the previous 3 slides] to show the login
modal and change the name back to “Anonymous”
• Why? We can’t set it here.. It is because sometime we can kick users
out of the system from firebase console or simply timeout expire.
• If we set the showing login modal code here, the kicking out case
will not trigger the modal show up.
• It is better to handle everything in onAuthStateChanged().
1.js
GetCurrentUser()
• Not used in the Chat App, but it is helpful in other apps.
• Although you can get the current user using the
getCurrentUser() method, it's better to use this from within the
callback function provided by onAuthStateChanged().
• However, if you need to get the current user, call the
getCurrentUser() method:
Login UI
1.js
Register UI
1.js
• Sign Out UI
• And putting
them in
render()
method.
1.js
Login Screen Register Screen
1.js
Register Successfully
Register Failed: 

Using Duplicated E-mail
1.js
Login Successfully Wrong E-mail Wrong Password
1.js
Sign Out Button Clicked.
1.js
Manage Users in Firebase Console
E-mail Templates
Password Reset
https://firebase.google.com/docs/reference/js/
firebase.auth.Auth#sendPasswordResetEmail
Confirm Password Reset
https://firebase.google.com/docs/reference/js/
firebase.auth.Auth.html#confirmPasswordReset
Verify Password Reset
• https://firebase.google.com/docs/reference/js/
firebase.auth.Auth.html#verifyPasswordResetCode
Making UI for Password
Reset
• Change "isShowLogin" boolean state variable to "show"
string state variable
• show == "login", will show login dialog.
• show == "register", will show register dialog.
• show == "passwordReset", will show password reset
dialog
• show == 'passwordConfirm', will show password
confirm dialog.
2 Additional Dialog UIs
• Password Reset Dialog needs
• E-mail
• Password Confirmation Dialog needs
• Code
• New Password
Facebook Login With
Firebase and Expo
• We can do Facebook with help of the Firebase and
Expo quite easily.
• https://docs.expo.io/versions/latest/sdk/
facebook.html
• You need an Facebook Developer ID, and create a
new Facebook app.
• https://developers.facebook.com/

Adding the following code..
2.js
For Facebook Login in iOS
https://developers.facebook.com/docs/facebook-login/ios
Facebook Developer App Setting
For Facebook Login in
Android
Facebook Developer App Setting
UI for Facebook Login
2.js
2.js
2.js
Q/A

More Related Content

What's hot

[JWAP-2] DI & Spring
[JWAP-2] DI & Spring[JWAP-2] DI & Spring
[JWAP-2] DI & SpringYoung-Ho Cho
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlowAiste Stikliute
 
[네이버오픈소스세미나] Next Generation Spring Security OAuth2.0 - 이명현
[네이버오픈소스세미나] Next Generation Spring Security OAuth2.0 - 이명현[네이버오픈소스세미나] Next Generation Spring Security OAuth2.0 - 이명현
[네이버오픈소스세미나] Next Generation Spring Security OAuth2.0 - 이명현NAVER Engineering
 
Oracle Forms: Introduction to multiple Forms
Oracle Forms: Introduction to multiple FormsOracle Forms: Introduction to multiple Forms
Oracle Forms: Introduction to multiple FormsSekhar Byna
 
Karate - powerful and simple framework for REST API automation testing
Karate - powerful and simple framework for REST API automation testingKarate - powerful and simple framework for REST API automation testing
Karate - powerful and simple framework for REST API automation testingRoman Liubun
 
Hello, ReactorKit 
Hello, ReactorKit Hello, ReactorKit 
Hello, ReactorKit Suyeol Jeon
 
Oracle Forms: Record Groups
Oracle Forms: Record GroupsOracle Forms: Record Groups
Oracle Forms: Record GroupsSekhar Byna
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with seleniumTzirla Rozental
 
Security for oauth 2.0 - @topavankumarj
Security for oauth 2.0 - @topavankumarjSecurity for oauth 2.0 - @topavankumarj
Security for oauth 2.0 - @topavankumarjPavan Kumar J
 
Java Spring framework, Dependency Injection, DI, IoC, Inversion of Control
Java Spring framework, Dependency Injection, DI, IoC, Inversion of ControlJava Spring framework, Dependency Injection, DI, IoC, Inversion of Control
Java Spring framework, Dependency Injection, DI, IoC, Inversion of ControlArjun Thakur
 
Different wait methods or commands in Selenium
Different wait methods or commands in SeleniumDifferent wait methods or commands in Selenium
Different wait methods or commands in SeleniumVinay Kumar Pulabaigari
 
Open authentication (oauth)
Open authentication (oauth)Open authentication (oauth)
Open authentication (oauth)Michael Maurice
 
Finally, easy integration testing with Testcontainers
Finally, easy integration testing with TestcontainersFinally, easy integration testing with Testcontainers
Finally, easy integration testing with TestcontainersRudy De Busscher
 
Testing ansible roles with molecule
Testing ansible roles with moleculeTesting ansible roles with molecule
Testing ansible roles with moleculeWerner Dijkerman
 
中正大學/FHIR 快速掃描 R4 版本
中正大學/FHIR 快速掃描 R4 版本中正大學/FHIR 快速掃描 R4 版本
中正大學/FHIR 快速掃描 R4 版本Lorex L. Yang
 
Vorontsov, golovko ssrf attacks and sockets. smorgasbord of vulnerabilities
Vorontsov, golovko   ssrf attacks and sockets. smorgasbord of vulnerabilitiesVorontsov, golovko   ssrf attacks and sockets. smorgasbord of vulnerabilities
Vorontsov, golovko ssrf attacks and sockets. smorgasbord of vulnerabilitiesDefconRussia
 

What's hot (20)

[JWAP-2] DI & Spring
[JWAP-2] DI & Spring[JWAP-2] DI & Spring
[JWAP-2] DI & Spring
 
REST API testing with SpecFlow
REST API testing with SpecFlowREST API testing with SpecFlow
REST API testing with SpecFlow
 
[네이버오픈소스세미나] Next Generation Spring Security OAuth2.0 - 이명현
[네이버오픈소스세미나] Next Generation Spring Security OAuth2.0 - 이명현[네이버오픈소스세미나] Next Generation Spring Security OAuth2.0 - 이명현
[네이버오픈소스세미나] Next Generation Spring Security OAuth2.0 - 이명현
 
React Native Firebase
React Native FirebaseReact Native Firebase
React Native Firebase
 
Oracle Forms: Introduction to multiple Forms
Oracle Forms: Introduction to multiple FormsOracle Forms: Introduction to multiple Forms
Oracle Forms: Introduction to multiple Forms
 
Karate - powerful and simple framework for REST API automation testing
Karate - powerful and simple framework for REST API automation testingKarate - powerful and simple framework for REST API automation testing
Karate - powerful and simple framework for REST API automation testing
 
Spring & hibernate
Spring & hibernateSpring & hibernate
Spring & hibernate
 
Hello, ReactorKit 
Hello, ReactorKit Hello, ReactorKit 
Hello, ReactorKit 
 
Oracle Forms: Record Groups
Oracle Forms: Record GroupsOracle Forms: Record Groups
Oracle Forms: Record Groups
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
 
Security for oauth 2.0 - @topavankumarj
Security for oauth 2.0 - @topavankumarjSecurity for oauth 2.0 - @topavankumarj
Security for oauth 2.0 - @topavankumarj
 
Java Spring framework, Dependency Injection, DI, IoC, Inversion of Control
Java Spring framework, Dependency Injection, DI, IoC, Inversion of ControlJava Spring framework, Dependency Injection, DI, IoC, Inversion of Control
Java Spring framework, Dependency Injection, DI, IoC, Inversion of Control
 
Different wait methods or commands in Selenium
Different wait methods or commands in SeleniumDifferent wait methods or commands in Selenium
Different wait methods or commands in Selenium
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
 
Open authentication (oauth)
Open authentication (oauth)Open authentication (oauth)
Open authentication (oauth)
 
Finally, easy integration testing with Testcontainers
Finally, easy integration testing with TestcontainersFinally, easy integration testing with Testcontainers
Finally, easy integration testing with Testcontainers
 
Testing ansible roles with molecule
Testing ansible roles with moleculeTesting ansible roles with molecule
Testing ansible roles with molecule
 
中正大學/FHIR 快速掃描 R4 版本
中正大學/FHIR 快速掃描 R4 版本中正大學/FHIR 快速掃描 R4 版本
中正大學/FHIR 快速掃描 R4 版本
 
Cucumber BDD
Cucumber BDDCucumber BDD
Cucumber BDD
 
Vorontsov, golovko ssrf attacks and sockets. smorgasbord of vulnerabilities
Vorontsov, golovko   ssrf attacks and sockets. smorgasbord of vulnerabilitiesVorontsov, golovko   ssrf attacks and sockets. smorgasbord of vulnerabilities
Vorontsov, golovko ssrf attacks and sockets. smorgasbord of vulnerabilities
 

Similar to Lecture 12: React-Native Firebase Authentication

React Native Firebase Realtime Database + Authentication
React Native Firebase Realtime Database + AuthenticationReact Native Firebase Realtime Database + Authentication
React Native Firebase Realtime Database + AuthenticationKobkrit Viriyayudhakorn
 
Easy logins for JavaScript web applications
Easy logins for JavaScript web applicationsEasy logins for JavaScript web applications
Easy logins for JavaScript web applicationsFrancois Marier
 
Easy logins for Ruby web applications
Easy logins for Ruby web applicationsEasy logins for Ruby web applications
Easy logins for Ruby web applicationsFrancois Marier
 
Integrating LINE Login with Firebase
Integrating LINE Login with Firebase Integrating LINE Login with Firebase
Integrating LINE Login with Firebase LINE Corporation
 
How to Validate Form With Flutter BLoC.pptx
How to Validate Form With Flutter BLoC.pptxHow to Validate Form With Flutter BLoC.pptx
How to Validate Form With Flutter BLoC.pptxBOSC Tech Labs
 
Code Camp Applying Modern Software Development Techniques To Ui Testing
Code Camp  Applying Modern Software Development Techniques To Ui TestingCode Camp  Applying Modern Software Development Techniques To Ui Testing
Code Camp Applying Modern Software Development Techniques To Ui TestingChristopherGTaylor
 
Leveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook AppsLeveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook AppsDavid Keener
 
Code your Own: Authentication Provider for Blackboard Learn
Code your Own: Authentication Provider for Blackboard LearnCode your Own: Authentication Provider for Blackboard Learn
Code your Own: Authentication Provider for Blackboard LearnDan Rinzel
 
7 Deadly Sins in Azure AD App Development
7 Deadly Sins in Azure AD App Development7 Deadly Sins in Azure AD App Development
7 Deadly Sins in Azure AD App DevelopmentJoonas Westlin
 
Robot framework - SAST Väst Q3
Robot framework - SAST Väst Q3Robot framework - SAST Väst Q3
Robot framework - SAST Väst Q3Anders Arnholm
 
Full Angular 7 Firebase Authentication System
Full Angular 7 Firebase Authentication SystemFull Angular 7 Firebase Authentication System
Full Angular 7 Firebase Authentication SystemDigamber Singh
 
Testing Connection Between Server to Server with TelegramBot & Googlesheet
Testing Connection Between Server to Server with TelegramBot & Googlesheet Testing Connection Between Server to Server with TelegramBot & Googlesheet
Testing Connection Between Server to Server with TelegramBot & Googlesheet kimsrung lov
 
My journey to use a validation framework
My journey to use a validation frameworkMy journey to use a validation framework
My journey to use a validation frameworksaqibsarwar
 
Introduction to OAuth 2.0 - the technology you need but never really learned
Introduction to OAuth 2.0 - the technology you need but never really learnedIntroduction to OAuth 2.0 - the technology you need but never really learned
Introduction to OAuth 2.0 - the technology you need but never really learnedMikkel Flindt Heisterberg
 
Cis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry universityCis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry universitylhkslkdh89009
 
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
 

Similar to Lecture 12: React-Native Firebase Authentication (20)

React Native Firebase Realtime Database + Authentication
React Native Firebase Realtime Database + AuthenticationReact Native Firebase Realtime Database + Authentication
React Native Firebase Realtime Database + Authentication
 
Easy logins for JavaScript web applications
Easy logins for JavaScript web applicationsEasy logins for JavaScript web applications
Easy logins for JavaScript web applications
 
Easy logins for Ruby web applications
Easy logins for Ruby web applicationsEasy logins for Ruby web applications
Easy logins for Ruby web applications
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Integrating LINE Login with Firebase
Integrating LINE Login with Firebase Integrating LINE Login with Firebase
Integrating LINE Login with Firebase
 
How to Validate Form With Flutter BLoC.pptx
How to Validate Form With Flutter BLoC.pptxHow to Validate Form With Flutter BLoC.pptx
How to Validate Form With Flutter BLoC.pptx
 
Code Camp Applying Modern Software Development Techniques To Ui Testing
Code Camp  Applying Modern Software Development Techniques To Ui TestingCode Camp  Applying Modern Software Development Techniques To Ui Testing
Code Camp Applying Modern Software Development Techniques To Ui Testing
 
Leveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook AppsLeveraging Rails to Build Facebook Apps
Leveraging Rails to Build Facebook Apps
 
Code your Own: Authentication Provider for Blackboard Learn
Code your Own: Authentication Provider for Blackboard LearnCode your Own: Authentication Provider for Blackboard Learn
Code your Own: Authentication Provider for Blackboard Learn
 
C Sharp Cornerarticle
C Sharp CornerarticleC Sharp Cornerarticle
C Sharp Cornerarticle
 
7 Deadly Sins in Azure AD App Development
7 Deadly Sins in Azure AD App Development7 Deadly Sins in Azure AD App Development
7 Deadly Sins in Azure AD App Development
 
Self-service Password Reset
Self-service Password ResetSelf-service Password Reset
Self-service Password Reset
 
Robot framework - SAST Väst Q3
Robot framework - SAST Väst Q3Robot framework - SAST Väst Q3
Robot framework - SAST Väst Q3
 
Full Angular 7 Firebase Authentication System
Full Angular 7 Firebase Authentication SystemFull Angular 7 Firebase Authentication System
Full Angular 7 Firebase Authentication System
 
Developing apps using Perl
Developing apps using PerlDeveloping apps using Perl
Developing apps using Perl
 
Testing Connection Between Server to Server with TelegramBot & Googlesheet
Testing Connection Between Server to Server with TelegramBot & Googlesheet Testing Connection Between Server to Server with TelegramBot & Googlesheet
Testing Connection Between Server to Server with TelegramBot & Googlesheet
 
My journey to use a validation framework
My journey to use a validation frameworkMy journey to use a validation framework
My journey to use a validation framework
 
Introduction to OAuth 2.0 - the technology you need but never really learned
Introduction to OAuth 2.0 - the technology you need but never really learnedIntroduction to OAuth 2.0 - the technology you need but never really learned
Introduction to OAuth 2.0 - the technology you need but never really learned
 
Cis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry universityCis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry university
 
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
 

More from Kobkrit Viriyayudhakorn

Chochae Robot - Thai voice communication extension pack for Service Robot
Chochae Robot - Thai voice communication extension pack for Service RobotChochae Robot - Thai voice communication extension pack for Service Robot
Chochae Robot - Thai voice communication extension pack for Service RobotKobkrit Viriyayudhakorn
 
ศักยภาพของ AI สู่โอกาสใหม่แห่งการแข่งขันและความสำเร็จ (Thai AI updates in yea...
ศักยภาพของ AI สู่โอกาสใหม่แห่งการแข่งขันและความสำเร็จ (Thai AI updates in yea...ศักยภาพของ AI สู่โอกาสใหม่แห่งการแข่งขันและความสำเร็จ (Thai AI updates in yea...
ศักยภาพของ AI สู่โอกาสใหม่แห่งการแข่งขันและความสำเร็จ (Thai AI updates in yea...Kobkrit Viriyayudhakorn
 
Thai Text processing by Transfer Learning using Transformer (Bert)
Thai Text processing by Transfer Learning using Transformer (Bert)Thai Text processing by Transfer Learning using Transformer (Bert)
Thai Text processing by Transfer Learning using Transformer (Bert)Kobkrit Viriyayudhakorn
 
หัวใจของปัญญาประดิษฐ์ (Gradient Descent ทำงานอย่างไร)
หัวใจของปัญญาประดิษฐ์ (Gradient Descent ทำงานอย่างไร)หัวใจของปัญญาประดิษฐ์ (Gradient Descent ทำงานอย่างไร)
หัวใจของปัญญาประดิษฐ์ (Gradient Descent ทำงานอย่างไร)Kobkrit Viriyayudhakorn
 
Check Raka Chatbot Pitching Presentation
Check Raka Chatbot Pitching PresentationCheck Raka Chatbot Pitching Presentation
Check Raka Chatbot Pitching PresentationKobkrit Viriyayudhakorn
 
[Lecture 3] AI and Deep Learning: Logistic Regression (Coding)
[Lecture 3] AI and Deep Learning: Logistic Regression (Coding)[Lecture 3] AI and Deep Learning: Logistic Regression (Coding)
[Lecture 3] AI and Deep Learning: Logistic Regression (Coding)Kobkrit Viriyayudhakorn
 
[Lecture 4] AI and Deep Learning: Neural Network (Theory)
[Lecture 4] AI and Deep Learning: Neural Network (Theory)[Lecture 4] AI and Deep Learning: Neural Network (Theory)
[Lecture 4] AI and Deep Learning: Neural Network (Theory)Kobkrit Viriyayudhakorn
 
[Lecture 2] AI and Deep Learning: Logistic Regression (Theory)
[Lecture 2] AI and Deep Learning: Logistic Regression (Theory)[Lecture 2] AI and Deep Learning: Logistic Regression (Theory)
[Lecture 2] AI and Deep Learning: Logistic Regression (Theory)Kobkrit Viriyayudhakorn
 
ITS488 Lecture 6: Music and Sound Effect & GVR Try out.
ITS488 Lecture 6: Music and Sound Effect & GVR Try out.ITS488 Lecture 6: Music and Sound Effect & GVR Try out.
ITS488 Lecture 6: Music and Sound Effect & GVR Try out.Kobkrit Viriyayudhakorn
 
Unity Google VR Cardboard Deployment on iOS and Android
Unity Google VR Cardboard Deployment on iOS and AndroidUnity Google VR Cardboard Deployment on iOS and Android
Unity Google VR Cardboard Deployment on iOS and AndroidKobkrit Viriyayudhakorn
 
ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2
ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2
ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2Kobkrit Viriyayudhakorn
 
Lecture 4: ITS488 Digital Content Creation with Unity - Game and VR Programming
Lecture 4: ITS488 Digital Content Creation with Unity - Game and VR Programming Lecture 4: ITS488 Digital Content Creation with Unity - Game and VR Programming
Lecture 4: ITS488 Digital Content Creation with Unity - Game and VR Programming Kobkrit Viriyayudhakorn
 
Lecture 2: C# Programming for VR application in Unity
Lecture 2: C# Programming for VR application in UnityLecture 2: C# Programming for VR application in Unity
Lecture 2: C# Programming for VR application in UnityKobkrit Viriyayudhakorn
 
Lecture 1 Introduction to VR Programming
Lecture 1 Introduction to VR ProgrammingLecture 1 Introduction to VR Programming
Lecture 1 Introduction to VR ProgrammingKobkrit Viriyayudhakorn
 
Lecture 3 - ES6 Script Advanced for React-Native
Lecture 3 - ES6 Script Advanced for React-NativeLecture 3 - ES6 Script Advanced for React-Native
Lecture 3 - ES6 Script Advanced for React-NativeKobkrit Viriyayudhakorn
 
สร้างซอฟต์แวร์อย่างไรให้โดนใจผู้คน (How to make software that people love)
สร้างซอฟต์แวร์อย่างไรให้โดนใจผู้คน (How to make software that people love)สร้างซอฟต์แวร์อย่างไรให้โดนใจผู้คน (How to make software that people love)
สร้างซอฟต์แวร์อย่างไรให้โดนใจผู้คน (How to make software that people love)Kobkrit Viriyayudhakorn
 

More from Kobkrit Viriyayudhakorn (20)

Thai E-Voting System
Thai E-Voting System Thai E-Voting System
Thai E-Voting System
 
Thai National ID Card OCR
Thai National ID Card OCRThai National ID Card OCR
Thai National ID Card OCR
 
Chochae Robot - Thai voice communication extension pack for Service Robot
Chochae Robot - Thai voice communication extension pack for Service RobotChochae Robot - Thai voice communication extension pack for Service Robot
Chochae Robot - Thai voice communication extension pack for Service Robot
 
ศักยภาพของ AI สู่โอกาสใหม่แห่งการแข่งขันและความสำเร็จ (Thai AI updates in yea...
ศักยภาพของ AI สู่โอกาสใหม่แห่งการแข่งขันและความสำเร็จ (Thai AI updates in yea...ศักยภาพของ AI สู่โอกาสใหม่แห่งการแข่งขันและความสำเร็จ (Thai AI updates in yea...
ศักยภาพของ AI สู่โอกาสใหม่แห่งการแข่งขันและความสำเร็จ (Thai AI updates in yea...
 
Thai Text processing by Transfer Learning using Transformer (Bert)
Thai Text processing by Transfer Learning using Transformer (Bert)Thai Text processing by Transfer Learning using Transformer (Bert)
Thai Text processing by Transfer Learning using Transformer (Bert)
 
How Emoticon Affects Chatbot Users
How Emoticon Affects Chatbot UsersHow Emoticon Affects Chatbot Users
How Emoticon Affects Chatbot Users
 
หัวใจของปัญญาประดิษฐ์ (Gradient Descent ทำงานอย่างไร)
หัวใจของปัญญาประดิษฐ์ (Gradient Descent ทำงานอย่างไร)หัวใจของปัญญาประดิษฐ์ (Gradient Descent ทำงานอย่างไร)
หัวใจของปัญญาประดิษฐ์ (Gradient Descent ทำงานอย่างไร)
 
Check Raka Chatbot Pitching Presentation
Check Raka Chatbot Pitching PresentationCheck Raka Chatbot Pitching Presentation
Check Raka Chatbot Pitching Presentation
 
[Lecture 3] AI and Deep Learning: Logistic Regression (Coding)
[Lecture 3] AI and Deep Learning: Logistic Regression (Coding)[Lecture 3] AI and Deep Learning: Logistic Regression (Coding)
[Lecture 3] AI and Deep Learning: Logistic Regression (Coding)
 
[Lecture 4] AI and Deep Learning: Neural Network (Theory)
[Lecture 4] AI and Deep Learning: Neural Network (Theory)[Lecture 4] AI and Deep Learning: Neural Network (Theory)
[Lecture 4] AI and Deep Learning: Neural Network (Theory)
 
[Lecture 2] AI and Deep Learning: Logistic Regression (Theory)
[Lecture 2] AI and Deep Learning: Logistic Regression (Theory)[Lecture 2] AI and Deep Learning: Logistic Regression (Theory)
[Lecture 2] AI and Deep Learning: Logistic Regression (Theory)
 
ITS488 Lecture 6: Music and Sound Effect & GVR Try out.
ITS488 Lecture 6: Music and Sound Effect & GVR Try out.ITS488 Lecture 6: Music and Sound Effect & GVR Try out.
ITS488 Lecture 6: Music and Sound Effect & GVR Try out.
 
Unity Google VR Cardboard Deployment on iOS and Android
Unity Google VR Cardboard Deployment on iOS and AndroidUnity Google VR Cardboard Deployment on iOS and Android
Unity Google VR Cardboard Deployment on iOS and Android
 
ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2
ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2
ITS488 Lecture 4: Google VR Cardboard Game Development: Basket Ball Game #2
 
Lecture 4: ITS488 Digital Content Creation with Unity - Game and VR Programming
Lecture 4: ITS488 Digital Content Creation with Unity - Game and VR Programming Lecture 4: ITS488 Digital Content Creation with Unity - Game and VR Programming
Lecture 4: ITS488 Digital Content Creation with Unity - Game and VR Programming
 
Lecture 2: C# Programming for VR application in Unity
Lecture 2: C# Programming for VR application in UnityLecture 2: C# Programming for VR application in Unity
Lecture 2: C# Programming for VR application in Unity
 
Lecture 1 Introduction to VR Programming
Lecture 1 Introduction to VR ProgrammingLecture 1 Introduction to VR Programming
Lecture 1 Introduction to VR Programming
 
Thai Word Embedding with Tensorflow
Thai Word Embedding with Tensorflow Thai Word Embedding with Tensorflow
Thai Word Embedding with Tensorflow
 
Lecture 3 - ES6 Script Advanced for React-Native
Lecture 3 - ES6 Script Advanced for React-NativeLecture 3 - ES6 Script Advanced for React-Native
Lecture 3 - ES6 Script Advanced for React-Native
 
สร้างซอฟต์แวร์อย่างไรให้โดนใจผู้คน (How to make software that people love)
สร้างซอฟต์แวร์อย่างไรให้โดนใจผู้คน (How to make software that people love)สร้างซอฟต์แวร์อย่างไรให้โดนใจผู้คน (How to make software that people love)
สร้างซอฟต์แวร์อย่างไรให้โดนใจผู้คน (How to make software that people love)
 

Recently uploaded

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 

Recently uploaded (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

Lecture 12: React-Native Firebase Authentication

  • 2.
  • 4. Very Easy
 to Fake an user. • This is bad. • We need something to check authority of the chatter. • We need a serious and professional chat app for serious things. • Let’s do the authentication.
  • 5. Firebase Authentication • Firebase Authentication provides backend services, easy-to-use SDKs, and ready-made UI libraries to authenticate users to your app. • API: https://firebase.google.com/docs/reference/js/ firebase.auth.Auth • It supports authentication using • Passwords • Federated Identity Providers • Google, Facebook, Twitter, and Github.
  • 8. Create New Project and Install Firebase • We will install Firebase • Open Terminal and change to a working directory • $|> create-react-native-app firebase2 • $|> cd firebase2 • $|> npm install firebase moment --save • $|> atom .
  • 9. Code From Previous Lecture • http://bit.ly/2zGjgfI
  • 11. 1.js
  • 12. • Firebase gives us a reactive method for listening for authentication. That is we can set up a listener to call a method when the user logs in and out. • When user is logout, the login modal will be shown up and reset the name back to the “Anonymous” • When user is login, the name text label at the header of the app is changed. 1.js
  • 13. • To sign a user in with their email and password, use the signInWithEmailAndPassword() function. It accepts two parameters, the user's email and password. • After user successfully login, it will hide the login modal, and trigger the onAuthStateChanged() [in the previous slide] to change the name. • If login failed, it will show alert popup with the error message. 1.js
  • 14. • We can create a user by calling the createUserWithEmailAndPassword() function. It accepts two parameters, an email and a password. • After an user successfully created, it will hide the login modal, and trigger the onAuthStateChanged() [in the previous 2 slides] to change the name. • If register failed, it will show alert popup with the error message. 1.js
  • 15. • To sign the current user out, use the signOut() method. It accepts no parameters • After an user successfully sign out, it will trigger the onAuthStateChanged() [in the previous 3 slides] to show the login modal and change the name back to “Anonymous” • Why? We can’t set it here.. It is because sometime we can kick users out of the system from firebase console or simply timeout expire. • If we set the showing login modal code here, the kicking out case will not trigger the modal show up. • It is better to handle everything in onAuthStateChanged(). 1.js
  • 16. GetCurrentUser() • Not used in the Chat App, but it is helpful in other apps. • Although you can get the current user using the getCurrentUser() method, it's better to use this from within the callback function provided by onAuthStateChanged(). • However, if you need to get the current user, call the getCurrentUser() method:
  • 19. • Sign Out UI • And putting them in render() method. 1.js
  • 20. Login Screen Register Screen 1.js
  • 21. Register Successfully Register Failed: 
 Using Duplicated E-mail 1.js
  • 22. Login Successfully Wrong E-mail Wrong Password 1.js
  • 23. Sign Out Button Clicked. 1.js
  • 24. Manage Users in Firebase Console
  • 28. Verify Password Reset • https://firebase.google.com/docs/reference/js/ firebase.auth.Auth.html#verifyPasswordResetCode
  • 29. Making UI for Password Reset • Change "isShowLogin" boolean state variable to "show" string state variable • show == "login", will show login dialog. • show == "register", will show register dialog. • show == "passwordReset", will show password reset dialog • show == 'passwordConfirm', will show password confirm dialog.
  • 30. 2 Additional Dialog UIs • Password Reset Dialog needs • E-mail • Password Confirmation Dialog needs • Code • New Password
  • 31. Facebook Login With Firebase and Expo • We can do Facebook with help of the Firebase and Expo quite easily. • https://docs.expo.io/versions/latest/sdk/ facebook.html • You need an Facebook Developer ID, and create a new Facebook app. • https://developers.facebook.com/

  • 32. Adding the following code.. 2.js
  • 33. For Facebook Login in iOS https://developers.facebook.com/docs/facebook-login/ios Facebook Developer App Setting
  • 34. For Facebook Login in Android Facebook Developer App Setting
  • 35. UI for Facebook Login 2.js
  • 36. 2.js
  • 37. 2.js
  • 38. Q/A