Android facebook sdk does not call callback after login

前端 未结 2 1780
野性不改
野性不改 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);
    }
    
    0 讨论(0)
  • 2021-02-11 17:20

    Having the attribute android:noHistory="true" set for your callback activity in the AndroidManifest.xml file will also result with the callback methods not firing.

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