0

I'm having a problem loging in programmatically, and after loging in, when I want the user to post something, when I check the acdtive session for isOpened() it returns false, so I cannot make any request...

Here is the login Code:

public void login()
{
    Session session = Session.getActiveSession();

    if (session == null) 
    {
        session = new Session.Builder(ResourceManager.getInstance().getMainActivity()).build();
        Session.setActiveSession(session);
    }

    if (!session.isOpened()) 
    {
        Session.OpenRequest openRequest = new Session.OpenRequest(ResourceManager.getInstance().getMainActivity());
        openRequest.setPermissions(PERMISSIONS);
        openRequest.setLoginBehavior(SessionLoginBehavior.SSO_WITH_FALLBACK);
        session.openForPublish(openRequest);
    }
}

And here is the code where I check if I can use the session:

public void post()
{
    Session session = Session.getActiveSession();
    if (session != null) 
    {
        // This returns always false, so it never goes in...
        if (session.isOpened())
        {
            postStatus(String pStatus);
        }
    }
}
Juanu
  • 530
  • 9
  • 23

1 Answers1

0

Try checking your key values that you set before in facebook. Wrong integration of the key values or any settings would make the facebook functions wierd or return unexpected results.

Same case here in this:post

Community
  • 1
  • 1
gorbos
  • 311
  • 1
  • 7