Facebook的安全警告,而用户​​已启用安全login – iPhone

我正在使用FBlogin的应用程序。 对于从faceBooklogin,我使用的是FBGraph,如果用户在他们的帐户中禁用了安全login,那么它工作正常,但是如果用户启用安全login,则会显示以下消息。

在这里输入图像说明

这是我用于login的代码

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"]; 

编辑:

从当前答案的build议,我已经在我的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";

但仍然没有成功….

请告诉我FBlogin解决scheme…..

谢谢………..

你应该使用Facebook的官方SDK。

从这里下载 – Facebook的SDK

Facebook

面向iOS的Facebook SDK 3.8是一个小的更新,增加了XCode 5和iOS 7支持,稳定性修复,自动权限刷新以及为(FBRequestConnection)指定批量请求参数的能力。

更改url:

  self.redirectUri = @"http://www.facebook.com/connect/login_success.html"; 

FBGraph.m到

  self.redirectUri = @"https://m.facebook.com/connect/login_success.html"; 

并检查。

这不是一个错误,而只是来自Facebook的安全警告。 而且我已经在我的申请中解决了这个问题。

检查FbGraph.m文件中的以下方法

 - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{ if([request.URL.relativeString hasPrefix:@"https://www.facebook.com/connect/login_success.html" ]) self.webView.hidden=TRUE; return YES; } 

检查它是否存在于文件中。 如果没有,那就去吧。