问题
my question is very similar to this: Facebook SDK Login dialog appears twice
" login dialog appears twice. How can I solve this problem?"
Except, I am using this singleton for communicating with the Facebook sdk: http://matt-swain.com/post/21160566904/facebook-ios-sdk-singleton (thats the code I'm using) http://barrycenter.com/BAM!coding/2011/07/simplifying-facebook-ios-sdk/ (old version including explanations)
The only difference between my code and the original singleton one is that I have a method:
-(void) postToWallWithDialog:(int)count2 {
NSMutableDictionary* params = [self buildPostParams:count2];
[self dialog:@"feed" andParams:params andDelegate:self]; //post
} //buildPostParams just makes a dictionary, nothing else.
I do not want to call my method from within fbDidLogin, because it needs to be called from the view controller.
how do i eliminate the second login dialog?
thanks!
回答1:
I ended up using FBNotifications to check if user in fact flogged in and whether or not there was a valid session. Knowing that, I posted to the wall and it eliminated the second dialog.
来源:https://stackoverflow.com/questions/12047303/ios-facebook-sdk-login-dialog-shows-up-twice-2-login-dialogs