0

My app requires the user to log in with Facebook to use it. When my app loads, I call Session.openActiveSession(). This opens Facebook's login form in a popup dialog. The user has the option to close the dialog. Is it possible to make the login form take up the entire page? This way, if the user wants to close Facebook's login form, my app also closes.

protected void onCreate(Bundle savedInstanceState) {

    ...

    Session.openActiveSession(this, true, Arrays.asList("email"), new Session.StatusCallback() {
        @Override
        public void call(Session session, SessionState state,
                Exception exception) {
            if (session.isOpened()) {
                ...
            }
        }
    });
}
Leo Jiang
  • 24,497
  • 49
  • 154
  • 284

1 Answers1

0

The recommended mechanism is for your app to communicate to the user that it requires the user to log in before continuing, rather than just closing.

If the user closes the dialog or cancels login, the status callback will move into a state of CLOSED_LOGIN_FAILED, and there should be a FacebookOperationCanceledException in the exception field, so you can always capture it there.

Ming Li
  • 15,672
  • 3
  • 37
  • 35