We got into the problem of logging into iOS facebook. When I log into facebook using my application, it asks for user permission using the "login" and "cancel" buttons. But this screen appears only for the first time. those. As soon as we logged in using a safari or application, and even if we left the facebook application, the application requesting user permission displays only the "ok" button. It does not allow logging in as another user. Why is the screen with the "login" and "cancel" buttons not displayed every time the application starts? I tried to delete cookies and delete NSUserDefaults, but with no luck.
The problem after logging out, I can not log in to facebook as another user. It is still displayed as the same user.
I call the following logout function in sdk
(void)logout:(id<FBSessionDelegate>)delegate { self.sessionDelegate = delegate; [_accessToken release]; _accessToken = nil; [_expirationDate release]; _expirationDate = nil; NSHTTPCookieStorage* cookies = [NSHTTPCookieStorage sharedHTTPCookieStorage]; NSArray* facebookCookies = [cookies cookiesForURL: [NSURL URLWithString:@"http://login.facebook.com"]]; for (NSHTTPCookie* cookie in facebookCookies) { [cookies deleteCookie:cookie]; } if ([self.sessionDelegate respondsToSelector:@selector(fbDidLogout)]) { [_sessionDelegate fbDidLogout]; } }
Also in the fbDidLogout delegate function, I deleted all NSUserDefaults objects
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; if ([defaults objectForKey:@"FBAccessTokenKey"]) { [defaults removeObjectForKey:@"FBAccessTokenKey"]; [defaults removeObjectForKey:@"FBExpirationDateKey"]; [defaults synchronize]; }
regrds shihab
source share