ios - Facebook session invalid after closing an app -


i'm working on app uses sso login facebook. i've followed tutorial on developer website ios , have working login , logout system :)

however, every time when startup app, session not valid (anymore) , it's asking me authorize app. possible session keeps valid, after closed app, , how implement that? i've tried following code:

// restore saved facebook credentials (if any) delegate.facebook.accesstoken = [[nsuserdefaults standarduserdefaults] stringforkey:@"fbaccesstoken"]; delegate.facebook.expirationdate = (nsdate *) [[nsuserdefaults standarduserdefaults] objectforkey:@"fbexpirationdate"]; // trigger sso facebook authentication if required if ([delegate.facebook issessionvalid] == no) { [delegate.facebook authorize:nil]; } else { [self fbloginwithusername:username andpassword:password]; } 

but still it's asking me authorize. it's annoying users see authorization window every time login. have idea this?

thanks in advance!

ensure nsuserdefaults string use accesstoken not nil , saving correctly.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -