我正在使用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