Difference session.isOpened() and session.getState().isOpened()

107 Views Asked by At

Can someone tell the difference between those states? And when to use which one?

1

There are 1 best solutions below

0
On

According to the facebook sdk reference page:

SessionState.isOpened()

Returns a boolean indicating whether the state represents a successfully opened state in which the Session can be used with a Request.

and

Session.isOpened()

Returns a boolean indicating whether the session is opened.

Maybe there's no real difference between them, but I recommend to use Session.isOpened() whenever you just want to know if the session is opened and the Session.getState().isOpened() if you need to know if it can be used with a Request.

https://developers.facebook.com/docs/reference/android/current/class/SessionState/ https://developers.facebook.com/docs/reference/android/current/class/Session/