I am getting this error when hitting the \"Login With Facebook\" (Simple login button).
I have Google, and read other topics here - but I can not see any thing mat
Actually this is happend. Because of the onActivityResult method has not implemented in side your Activity and also you must call
callbackManager.onActivityResult(requestCode, resultCode, data);
method inside this method. I am sure 100% your problem resolved.
In my case i forgot to add application package name and class name on the developer page of facebook. After i added this information then it worked.
You should add this to your acctivity
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
callbackManager.onActivityResult(requestCode, resultCode, data);
}
but if your using parse SDK add this
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
ParseFacebookUtils.onActivityResult(requestCode, resultCode, data);
}
I too had this issue. Mine however was a login call made within the FBActivity.OnResume
method for callbacks to login after accepting fb perms.
I simply moved the request into the profile tracker in the onCreate
method
ProfileTracker profileTracker = new ProfileTracker() {
@Override
protected void onCurrentProfileChanged(Profile oldProfile, Profile currentProfile) {
Profile.fetchProfileForCurrentAccessToken();
if(currentProfile != null) {
String fbUserId = currentProfile.getId();
profileUrl = currentProfile.getProfilePictureUri(200, 200).toString();
Log.d("FB profile", "got new/updated profile from thread " + fbUserId);
// jump if logged in already
GetFacebookProfileAndJump(currentProfile);
}
}
};
Also ensure your OnCreate
super is as follows
FacebookSdk.sdkInitialize(getApplicationContext());
mCallbackmanager = CallbackManager.Factory.create();
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fbauth_);
...
Check your android:noHistory flag on the activity.
See link https://developers.facebook.com/bugs/1621984714705591/ look for post by Andreas Bergenwall
I had the same problem, and solved by putting the facebook_app_id
to strings.xml
instead of a constant:
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id" />