ios - How to make a FBSession with Facebook oauth token? -



ios - How to make a FBSession with Facebook oauth token? -

i have used social framework login facebook , got token. know how set fbsession in facebook sdk? want create session token, set fbsession.activesession, synchronize :). guys.

acaccounttype *facebookaccounttype = [self.accountstore accounttypewithaccounttypeidentifier:acaccounttypeidentifierfacebook]; nsdictionary *options = @{ @"acfacebookappidkey" : @"123456789", @"acfacebookpermissionskey" : @[@"publish_stream"], @"acfacebookaudiencekey" : acfacebookaudienceeveryone}; // needed when write permissions requested [self.accountstore requestaccesstoaccountswithtype:facebookaccounttype options:options completion:^(bool granted, nserror *error) { if (granted) { nsarray *accounts = [self.accountstore accountswithaccounttype:facebookaccounttype]; self.facebookaccount = [accounts lastobject]; acaccountcredential *facebookcredential = [facebookaccount credential]; nsstring *accesstoken = [facebookcredential oauthtoken]; } else { nslog(@"%@",error); // fail gracefully... } }];

ios facebook social-framework

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -