我已經成功將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