我已经成功将Facebook集成到了ios 6中,但我注意到了应用程序的一个奇怪的行为。 每当我尝试使用Facebook登录时,一切正常,但当任何其他用户使用他/她的凭据尝试登录时,会显示错误。我不知道它有什么解决方案。在facebook集成中登录问题
我使用Facebook的sdk示例代码作为参考。对于登录,我只是设置登录视图框架。 FBLoginView的协议实现如下:
- (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提前...!
可能是权限,在这里发布您的FBLoginView代码,那么我们将能够帮助您更多。 – 2013-02-19 09:23:21
请张贴一些代码或张贴错误:) – Rushabh 2013-02-19 09:31:42
你正在得到什么错误? – 2013-02-19 13:27:31