android - facebook - recover from CLOSE_LOGIN_FAILED when user hits cancel button -
in app when user hits facebook login button, facebook displays page asking him confirm permissions - ask email permission in addition public_profile. if user hits "cancel" , exits main page session state becomes closed_login_failed. if user hits facebook login button again, permissions page displayed again, time shows "public_profile". how can make ask email when session state closed_login_failed?
here code:
if(!session.isopened() && !session.isclosed()) { session.openforread(new session.openrequest(context).setcallback(statuscallback).setpermissions(arrays.aslist("email"))); } else { session.openactivesession(context, true, statuscallback); }
achieved following code:
if (session.isopened()) { session.openactivesession(activity, true, statuscallback); } else if(session.getstate().equals(sessionstate.created)) { session.openforread(new session.openrequest(activity).setcallback(statuscallback).setpermissions(read_permissions)); } else { //deal closed_login_failed , other session types session = new session(activity); session.setactivesession(session); session.openforread(new session.openrequest(activity).setcallback(statuscallback).setpermissions(read_permissions)); }
Comments
Post a Comment