用户启用安全登录时facebook安全警告-iPhone

用户启用安全登录时facebook安全警告-iPhone,iphone,ios,objective-c,facebook-graph-api,fb-graph,Iphone,Ios,Objective C,Facebook Graph Api,Fb Graph,我正在开发一个使用FB登录的应用程序。对于从faceBook登录,我使用的是FBGraph,如果用户在其帐户中禁用了安全登录,它可以正常工作,但如果用户启用了安全登录,则会显示以下消息 这是我用来登录的代码 self.fbGraph = [[FbGraph alloc] initWithFbClientID:client_id]; [fbGraph authenticateUserWithCallbackObject:self andSelector:@selector(fbGrap

我正在开发一个使用FB登录的应用程序。对于从faceBook登录,我使用的是FBGraph,如果用户在其帐户中禁用了安全登录,它可以正常工作,但如果用户启用了安全登录,则会显示以下消息

这是我用来登录的代码

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中添加了以下代码,但通过这些代码,我得到了标记nil

- (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登录的解决方案


谢谢……。

这不是一个错误,只是来自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;
}
检查它当前是否存在于文件中。如果没有,那么就去做。

更改url:

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

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

然后检查。

您应该使用Facebook的官方SDK

从这里下载-

Facebook

FacebookSDK3.8foriOS是一个小型更新,添加了XCode 5和 iOS 7支持、稳定性修复、自动权限刷新和 能够为(FBRequestConnection)指定批处理请求参数


但在本例中,token为零