facebook安全警告用户已启用安全登录 - iPhone [英] facebook Security Warning while user has enabled secure login - 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 *)请求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屋!