开发者

Facebook share dialog not quite working in iOS

I'm having a strange issue with the Facebook share dialog, and the documentation isn't much of a help. I'm using the dialog:andParams:andDelegate method to show it, and the first time, a login dialog shows up. If I enter incorrect credentials, it just closes and doesn't tell me they were incorrect. If I enter correct credentials, it just closes too, without showing t开发者_StackOverflowhe share dialog. However, the next time I call the dialog:andParams:andDelegate: method, it goes straight to the share dialog, and it works fine.

My question is, why is the dialog being completely dismissed when I try to log in? I'm not doing anything with the session before displaying the dialog, because it seems like it should handle that itself, right? Or do I explicitly have to handle a logged out session, so it displays the dialog correctly?


I do not know if that can be of any help but I use ShareKit to share stuff on social network (Facebook, Twitter, and some more). This API is really nice though.


You need to check if you're if you're logged in, if not call:

[facebook_ authorize:permissions_];

and then listen to:

-(void)fbDidLogin;

and save the auth tokens:

NSUserDefaults * prefs = [NSUserDefaults standardUserDefaults];
[prefs setObject:facebook_.accessToken forKey:@"AccessToken"];
[prefs setObject:facebook_.expirationDate forKey:@"ExpirationDate"];
[prefs synchronize];

And after the successful login call the share dialog:

[facebook_ dialog:@"feed" andParams:params andDelegate:self];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜