Android facebook sdk does not call callback after login

前端 未结 2 1778
野性不改
野性不改 2021-02-11 16:30

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

2条回答
  •  遥遥无期
    2021-02-11 17:15

    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);
    }
    

提交回复
热议问题