public void authenticate(final Activity context, final String[] permissions, final boolean sso) { facebookSessionStore.restore(facebook, context); FacebookDialogListener facebookDialogListener = new FacebookDialogListener(context, facebook, facebookSessionStore, listener) { @Override public void onFinish() { finish(context); } @Override public void handleError(Throwable error) { if (listener != null) { listener.onError(new SocializeException(error)); } else { doError(context, error, permissions, sso); } } }; if (sso) { facebook.authorize(context, permissions, facebookDialogListener); } else { facebook.authorize(context, permissions, Facebook.FORCE_DIALOG_AUTH, facebookDialogListener); } }
public void logout(Activity context) { try { facebook.logout(context); } catch (Exception e) { if (listener != null) { listener.onError(new SocializeException(e)); } else { if (logger != null) { logger.error(e.getMessage(), e); } else { e.printStackTrace(); } } } }