내 애플 리케이션에서 페이스 북을 사용하고 있습니다. 내 앱과 통합 된 FB입니다. 로그인도 올바르게 발생합니다. 그러나 로그 아웃하려고 할 때 fbDidLogout에 로그 아웃이 성공했음을 보여 주지만 다시 로그인하려고하면 이전에 입력 한 사용자 이름과 비밀번호로 로그인 페이지와 로깅을 표시하는 것입니다.로그 아웃 페이스 북에서
어떻게 로그 아웃 할 수 있습니까?
어느 하나에게 도움을 요청하거나 제안 할 수 있습니다 여기에
는- (IBAction)LoginOrLogout
{
// If the user is not connected (logged in) then connect. Otherwise logout.
if (!isConnected)
{
// Set the permissions.
// Without specifying permissions the access to Facebook is imposibble.
permissions = [[NSArray arrayWithObjects:@"read_stream", @"publish_stream", nil] retain];
// Set the Facebook object we declared. We’ll use the declared object from the application
// delegate.
facebook = [[Facebook alloc] initWithAppId:@"329082513817407" andDelegate:self];
[btnPublish setHidden:NO];
[messageTextField setHidden:NO];
[facebook authorize:permissions];
// Change the lblUser label's message.
[lblUser setText:@"Please wait..."];
isConnected = YES;
[self setLoginButtonImage];
}
else
{
[facebook logout:self];
[messageTextField setHidden:YES];
[lblUser setText:@"Tap on the Login to connect to Facebook"];
isConnected = NO;
[self setLoginButtonImage];
}
}
이들은 다른 방법이 내 코드
이것은 로그인 로그 아웃 버튼 동작입니다
-(void)fbDidLogin
{
// Save the access token key info.
[self saveAccessTokenKeyInfo];
// Get the user's info.
[facebook requestWithGraphPath:@"me" andDelegate:self];
}
-(void)fbDidNotLogin:(BOOL)cancelled
{
UIAlertView *al = [[UIAlertView alloc] initWithTitle:@"Tonify" message:@"Login cancelled." delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
[al show];
[self LoginOrLogout];
}
-(void)fbDidLogout
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSLog(@"defaults fbDidLogout ........%@",defaults);
if ([defaults objectForKey:@"FBAccessTokenKey"])
{
[defaults removeObjectForKey:@"FBAccessTokenKey"];
[defaults removeObjectForKey:@"FBExpirationDateKey"];
[defaults synchronize];
}
NSLog(@"defaults fbDidLogout ........%@",defaults);
NSLog(@"logout success!");
// Keep this for testing purposes.
NSLog(@"Logged out Succes");
// Hide the publish button.
[btnPublish setHidden:YES];
}
감사합니다. 작동 중입니다. –