Setup Facebook Login
Android
A) Open https://developers.facebook.com/ link. And login to facebook developer account.
B) Click on My Apps. Then Click onAdd New App button to add new application into facebook developer account.
C) Fill all the detail, i.e., Display Name, and Contact Email. Then Click on Create App ID
D) You will be redirect to Facebook application console.
E) Click on SET UP button on Facebook Login to set up login from Facebook.
F) Now select Android to setup platform.
G) Click on Next button for next step.
H) Again click on Next button.
I) Add package name as your package name, and activity name as LogInActivity. And click on Save Then click on Use this package namebutton. Then click on Continue button.
J) Then generate Key hash by following below steps. (It works when package name in Constant file strings MyPREFERENCES and PACKAGE_NAME are proper as per your package name).
- Open CiyaShop project in Android Studio. And run project. Navigate to Logcat option and make sure that you are on error path.
- Search for “hashkey” in Logcat. You will find key hash in that copy that key hash.
K) Provide key hash in Facebook console. Then click on Save button and then Click on Continue
L) Then enable Single Sign On. And then click on Save Then click on Next button.
M) Then continuously click on Next button and then redirect to Facebook application console.
N) Then make application live by doing the button on status to ON at the top of the page.
O) Now copy Facebook APP ID and then open CiyaShop project in Android Studio. Then navigate to ..\\res\values\strings.xml and paste Facebook App ID in “facebook_app_id”, and “fb_login_protocol_scheme” with ‘fb’ prefix.
NOTES:- How to create Hash Key for Live Application and Debug(Development time) application for Facebook login.
Debug Application
Live Application