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