在facebook集成中登录问题 [英] Login issue in facebook integration
本文介绍了在facebook集成中登录问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
每当我尝试使用Facebook登录时,一切都可以正常工作,但是当任何其他具有他/她的凭据的用户尝试登录时,会出现错误。我不知道它的解决方案。
我正在使用Facebook sdk示例代码作为参考。对于登录我只是设置视图框架进行登录。 FBLoginView的协议实现如下:
- (void)loginViewShowingLoggedInUser:(FBLoginView *)loginView
{
BOOL canShareAnyhow = [FBNativeDialogs canPresentShareDialogWithSession:nil];
//首先获取设置登录模式的按钮
self.postStatusBtn.enabled = YES;
self.shareWithFriendsBtn.enabled = YES;
self.viewFriends.enabled = YES;
}
- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView
用户:(id< FBGraphUser>)用户
{
//这里我们使用FBGraphUser的帮助器属性来从服务器点到first_name和
// id属性的json响应;或者我们可以使用
// NSDictionary方法,如objectForKey从我的json对象获取值
//设置FBProfilePictureView实例的profileID属性
//导致控件获取并显示用户的个人资料图片
self.profilePic.profileID = user.id;
self.loggedInUser = user;
NSLog(@%@,user);
}
- (void)loginViewShowingLoggedOutUser:(FBLoginView *)loginView
{
BOOL canShareAnyhow = [FBNativeDialogs canPresentShareDialogWithSession:nil];
self.postStatusBtn.enabled = NO;
self.shareWithFriendsBtn.enabled = NO;
self.viewFriends.enabled = NO;
if(!self.viewFriends.enabled)
{
self.viewFriends.titleLabel.textColor = [UIColor grayColor];
}
if(!self.shareWithFriendsBtn.enabled)
{
self.shareWithFriendsBtn.titleLabel.textColor = [UIColor grayColor];
}
if(!self.postStatusBtn.enabled)
{
self.postStatusBtn.titleLabel.textColor = [UIColor grayColor];
}
self.profilePic.profileID = nil;
self.loggedInUser = nil;
}
提前Thanx ... !!
解决方案
我认为这将解决您的问题:
-
-
- 转到基本信息标签
- 沙箱模式: 将此设置为禁用
- 保存设置。
这将适用于您。
I have integrated facebook in ios 6 successfully but i noticed a strange behaviour of the app. Whenever i try to login using facebook everything works fine but when any other user with his/her credentials tries to login, an error shows up. I don't know what's the solution for it.
i am using facebook sdk sample code as reference. For login i am just setting the view frame for login. The protocol implementation for FBLoginView is as follows:
- (void)loginViewShowingLoggedInUser:(FBLoginView *)loginView
{
BOOL canShareAnyhow = [FBNativeDialogs canPresentShareDialogWithSession:nil];
// first get the buttons set for login mode
self.postStatusBtn.enabled = YES;
self.shareWithFriendsBtn.enabled = YES;
self.viewFriends.enabled = YES;
}
- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView
user:(id<FBGraphUser>)user
{
// here we use helper properties of FBGraphUser to dot-through to first_name and
// id properties of the json response from the server; alternatively we could use
// NSDictionary methods such as objectForKey to get values from the my json object
// setting the profileID property of the FBProfilePictureView instance
// causes the control to fetch and display the profile picture for the user
self.profilePic.profileID = user.id;
self.loggedInUser = user;
NSLog(@"%@",user);
}
- (void)loginViewShowingLoggedOutUser:(FBLoginView *)loginView
{
BOOL canShareAnyhow = [FBNativeDialogs canPresentShareDialogWithSession:nil];
self.postStatusBtn.enabled = NO;
self.shareWithFriendsBtn.enabled = NO;
self.viewFriends.enabled = NO;
if (!self.viewFriends.enabled)
{
self.viewFriends.titleLabel.textColor = [UIColor grayColor];
}
if(!self.shareWithFriendsBtn.enabled)
{
self.shareWithFriendsBtn.titleLabel.textColor = [UIColor grayColor];
}
if (!self.postStatusBtn.enabled)
{
self.postStatusBtn.titleLabel.textColor = [UIColor grayColor];
}
self.profilePic.profileID = nil;
self.loggedInUser = nil;
}
Thanx in advance...!!
解决方案
I think this will fix your issue:
- Go to you Facebook app in your Facebook account.
- Click edit your app.
- Go to Basic info tab.
- Sandbox Mode: check this as Disable
- Save the setting.
This will work for you.
这篇关于在facebook集成中登录问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文