我正在使用FB登錄的應用程序。對於來自Facebook登錄我使用FBGraph,如果用戶在他們的帳戶禁用安全登錄,但如果用戶啓用安全登錄,然後它給下面的消息,它工作正常..facebook安全警告,而用戶已啓用安全登錄 - iPhone
這裏是我的代碼用於登錄
self.fbGraph = [[FbGraph alloc] initWithFbClientID:client_id];
[fbGraph authenticateUserWithCallbackObject:self andSelector:@selector(fbGraphCallback:)
andExtendedPermissions:@"user_photos,user_videos,publish_stream,offline_access,user_checkins,friends_checkins"];
編輯:
從建議從目前的答案,我已經添加下面的代碼在我FBGraph.m但有了這個代碼,我得到令牌爲零。
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{
NSLog(@"\n\n\nrequest.URL.relativeString = %@\n\n\n",request.URL.relativeString);
if([request.URL.relativeString hasPrefix:@"https://www.facebook.com/connect/login_success.html" ]||[request.URL.relativeString hasPrefix:@"http://www.facebook.com/connect/login_success.html" ]||[request.URL.relativeString hasPrefix:@"http://m.facebook.com/connect/login_success.html" ])
{
[self.webView stopLoading];
[[self.webView superview] removeFromSuperview];
//tell our callback function that we're done logging in :)
if ((callbackObject != nil) && (callbackSelector != nil)) {
[callbackObject performSelector:callbackSelector];
}
return NO;
}
return YES;
}
我也改變了
self.redirectUri = @"http://www.facebook.com/connect/login_success.html";
要
self.redirectUri = @"http://m.facebook.com/connect/login_success.html";
但仍然沒有成功....
請告訴我FB登錄解決方案.....
謝謝...........
但在這種情況下,令牌是零 – 2013-10-08 09:42:22