Android facebook sdk does not call callback after login

前端 未结 1 2071
一个人的身影
一个人的身影 2021-02-11 16:49

Help,

I am trying to make a class that handles facebook login in my application. My problem is it doesnt work on all activity. On that activity it doesnt call the callba

1条回答
  •  南方客
    南方客 (楼主)
    2021-02-11 17:22

    maybe you forget to handle the results after login...

    check the override method onActivityResult..

    because it handle the results back to the MainActivity,

    maybe this can help your problem..

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        Session.getActiveSession().onActivityResult(this, requestCode,
                resultCode, data);
    }
    

    Update 1

    For newer SDK use:

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

    0 讨论(0)
提交回复
热议问题