IOS Facebook sdk login Dialog shows up twice (2 login dialogs)

橙三吉。 提交于 2019-12-13 07:27:56

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!