Skip to content

Demo app for How to Integrate Facebook-sdk in your android app and login with facebook. I have used Glide library to set the Profile Image and Butter Knife to instantiate the object of the Widget very easily

Notifications You must be signed in to change notification settings

harsh6768/LoginWithFacebook

Repository files navigation

LoginWithFacebook

This Demo app will show how to login with facebook and fetch the data like image ,birthday,email and total friends.

For more details

https://developers.facebook.com/docs/facebook-login/android

Add Dependency at App level Gradle file:

  1. Glide is Used to set the Images https://github.com/bumptech/glide

  2. ButterKnife is to instantiate the widget http://jakewharton.github.io/butterknife/

3. Facebook sdk

dependency

you will get app_id and fb_login_protocol_scheme by creating the project on Developer.facebook.com

Add Metadata and permissions in Manifest File:

Permission:

Add Internet Permission

Metadata and Activity:

<meta-data android:name="com.facebook.sdk.ApplicationId"
    android:value="@string/facebook_app_id"/>

<activity android:name="com.facebook.FacebookActivity"
    android:configChanges=
        "keyboard|keyboardHidden|screenLayout|screenSize|orientation"
    android:label="@string/app_name" />

<activity
    android:name="com.facebook.CustomTabActivity"
    android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="@string/fb_login_protocol_scheme" />
    </intent-filter>
</activity>

For Getting the KeyHash Value:

Last and most important past You have to generate keyhash value:

  1. You need to install openssl in your computer
  2. Goto C:\Program Files\Java\jre1.8.0_161\bin using command prompt
  3. Goto openssl >>then bin >> copy that path path openssl: E:\Software\openssl\bin\openssl.exe
  4. enter this command>> keytool -exportcert -alias androiddebugkey -keystore "C:\Users"Username_Of_Your_Computer_Or_Laptop".android\debug.keystore" | "Paste_OpenSSl_Path" sha1 -binary |"Paste_OpenSSl_Path " base64

facebook_login_harsh_key

5.after this command prompt asked Enter KeyStore Password:

keyhash

About

Demo app for How to Integrate Facebook-sdk in your android app and login with facebook. I have used Glide library to set the Profile Image and Butter Knife to instantiate the object of the Widget very easily

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages