facebook安全警告用户已启用安全登录 - iPhone [英] facebook Security Warning while user has enabled secure login - iPhone

查看:173
本文介绍了facebook安全警告用户已启用安全登录 - iPhone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个使用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中添加了以下代码。但是,使用这段代码,我得到了无效。

   - (BOOL) webView:(UIWebView *)webView shouldStartLoadWithRequest :( NSURLRequest *)请求navigationType:(UIWebViewNavigationType)navigationType {

NSLog(@\\\
\\\
\\\
request.URL.relativeString =%@ \
\\\
\\\
,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];

//告诉我们完成登录的回调函数:)
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的官方SDK。



从这里下载 - Facebook SDK



Facebook


Facebook SDK 3.8 for iOS是一个小的更新,增加了XCode 5和
的iOS 7支持,稳定性修复,自动权限刷新和
指定批处理请求参数(FBRequestConnection)的功能。



I am working on an application which uses FB login. For login from faceBook I am using FBGraph and it works fine if users have disabled secure login in their account, but if user enables the secure login then it gives following message..

Here is my code i used for 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"];

EDIT:

From suggestions from current answers, I have added following code in my FBGraph.m But with this code i am getting token 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;
}

I have also changed

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

To

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

But still no success....

Please tell me the solution for FB Login.....

Thanks...........

解决方案

You should use Facebook's official SDK.

Download it from here - Facebook SDK

Facebook says

The Facebook SDK 3.8 for iOS is a minor update that adds XCode 5 and iOS 7 support, stability fixes, automatic permissions refresh and the ability to specify batch request parameters to (FBRequestConnection).

这篇关于facebook安全警告用户已启用安全登录 - iPhone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆