Issues creating login button using Facebook SDK 4.1.2

后端 未结 4 2114
滥情空心
滥情空心 2021-01-24 07:15

I am trying to create an application, which will allow users to sign in via their Facebook accounts. I wanted to use the new Facebook SDK 4.1.2 via eclipse. To use the new SDK i

4条回答
  •  终归单人心
    2021-01-24 07:32

    I don't see in your code onActivityResult method. It is required for properly SDK workflow.

    You need to add it to the MainActivity:

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        callbackManager.onActivityResult(requestCode, resultCode, data);
    }
    

    Cause:

    Every activity and fragment that you integrate with the FacebookSDK Login or Share should forward onActivityResult to the callbackManager.

    You can find it in documentation here.

提交回复
热议问题