Since Facebook has recently changed too many internal settings, it's better to use the Facebook SDK rather than Social Auth
To get started with Facebook sdk you need to create a project in the facebook developer console, kindly see the link below to continue .
One application was created to download and import the latest facebook sdk into your project
After importing, set facebook sdk as a library project for your eclipse
add below code to your mainfestifile application tag
<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:theme="@android:style/Theme.Translucent.NoTitleBar" />
where facebook_app_id is the application identifier created when creating the project in the developer console
Remember to enable Internet access permissions
then add the following code to your activity
// variables must be declared
CallbackManager callbackManager; ShareDialog shareDialog;
// in action oncreate
FacebookSdk.sdkInitialize(getApplicationContext()); callbackManager = CallbackManager.Factory.create(); shareDialog = new ShareDialog(this);
// For example, sharing adds the code snippet below to the buttonβs click list
ShareLinkContent content = new ShareLinkContent.Builder() .setContentUrl(Uri.parse(copyTextToClipBoard())) .build(); shareDialog.show(content);
source share