get user facebook permissions

前端 未结 1 1567
半阙折子戏
半阙折子戏 2021-01-17 02:51

I want to add a facebook permission to my users. That is how I do it:

Session.openActiveSession(this, true, new Session.StatusCallback() {
        @Override
         


        
相关标签:
1条回答
  • 2021-01-17 03:40

    use below code

    Session session = getActiveSession();
    if(session.isOpened)
    {
      List<String> permissions = session.getPermissions();
        if(!permissions.contain("email"))
        {
     Session.NewPermissionsRequest newPermissionsRequest = new Session.NewPermissionsRequest(MainActivity.this,
                                PERMISSIONS);
                        session.requestNewReadPermissions(newPermissionsRequest);
    
    }
    }else
    {
    Session.openActiveSession(this, true,callback);
    }
    
    0 讨论(0)
提交回复
热议问题