android - Parse.com becomeInBackground Invalid Session Token -
i trying logout current user. login user, delete user. come original user. have far... works fine, except not log in original user... says invalid session token. session token retrieved using currentuser.getsessiontoken()
how invalid??
ps: have enabled session on parse dashboard , in app:
parseuser.enablerevocablesessioninbackground();
code:
parseuser currentuser = parseuser.getcurrentuser(); final string sessiontoken = currentuser.getsessiontoken(); log.d(tag, currentuser.getobjectid() + " sessiontoken: " + sessiontoken); parseuser.logout(); parseuser.logininbackground(usertest, passtest, new logincallback() { @override public void done(final parseuser onlineuser, parseexception e) { if ((e == null) && (onlineuser != null)) { log.d(tag, "onlineuser.deleteinbackground..."); onlineuser.deleteinbackground(new deletecallback() { @override public void done(parseexception e) { if (e == null) { log.d(tag, "onlineuser.deleted!"); parseuser.logout(); parseuser.becomeinbackground(sessiontoken, new logincallback() {@override public void done(parseuser user, parseexception e) { if ((e == null) && (user !=null)){ log.d(tag, "user retrieved..."); } else { log.d(tag, "user failed retrieved..."); if (e != null) log.d(tag, "parseuser.becomeinbackground error: " + e.tostring()); } }); } } }); } } });
Comments
Post a Comment