Android Facebook session issue

后端 未结 2 549
遇见更好的自我
遇见更好的自我 2020-12-17 01:54

I have used following code for Facebook authentication and it is working fine, but when I have cancelled the authentication and tried to authenticate again the app crashed a

2条回答
  •  感动是毒
    2020-12-17 02:29

    I too had same problem, but i solved with these lines. To my knowledge we cannot request a session for new permissions which is already opened.

    Session session = new Session(this);
        Session.setActiveSession(session);
        session.openForRead(new Session.OpenRequest(this).setCallback(callback).setPermissions(Arrays.asList("your_permissions")));
    

    I hope you already added below line in onActivityResult()

    Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);
    

提交回复
热议问题