FBDialog取消按钮回调
当用户单击继承自 FBDialog 的 FBStreamDialog 中的“取消”按钮时,我无法将其与用户单击“发布”按钮时区分开来。似乎无论单击哪个按钮,回调 FBDialog DismissWithSuccess 总是以状态:NO 传递。我做错了什么?谢谢!
这是处理我的应用程序中所有 FBConnect 的类:
@interface SocialMediaViewController : UIViewController <FBSessionDelegate, FBRequestDelegate, FBDialogDelegate> {...
这是我实例化登录的方式。
FBLoginDialog* dialog = [[[FBLoginDialog alloc] initWithSession:self.fbSession] autorelease];
dialog.delegate = self;
[dialog show];
以下是我实例化 FBStreamDialog 的方法。
FBStreamDialog* dialog = [[FBStreamDialog alloc] init];
dialog.delegate = self;
dialog.userMessagePrompt = @"Enter additional comment:";
dialog.attachment = [NSString stringWithFormat:@"{\"name\":\"My name string %@\"," "\"href\":\"http://xyz.com/\"," "\"caption\":\"placeholder-%@\",\"description\":\"%@\"," "\"properties\":{\"More like this\":{\"text\":\"XYZ website\",\"href\":\"http://XYZ.com/\"}}}", self.curReview.businessName, self.curReview.reviewType, self.curReview.reviewDetail];
[dialog show];
When user hits the Cancel button in the FBStreamDialog, which inherits from FBDialog, I am having trouble differentiating it from when user clicks on the Publish button. Seems that the callback FBDialog dismissWithSuccess is always passed with the status:NO regardless of which button is clicked. What am I doing wrong? Thanks!
Here's the class that handles all the FBConnect in my app:
@interface SocialMediaViewController : UIViewController <FBSessionDelegate, FBRequestDelegate, FBDialogDelegate> {...
Here's how I instantiated the login.
FBLoginDialog* dialog = [[[FBLoginDialog alloc] initWithSession:self.fbSession] autorelease];
dialog.delegate = self;
[dialog show];
Here's how I instantiated the FBStreamDialog.
FBStreamDialog* dialog = [[FBStreamDialog alloc] init];
dialog.delegate = self;
dialog.userMessagePrompt = @"Enter additional comment:";
dialog.attachment = [NSString stringWithFormat:@"{\"name\":\"My name string %@\"," "\"href\":\"http://xyz.com/\"," "\"caption\":\"placeholder-%@\",\"description\":\"%@\"," "\"properties\":{\"More like this\":{\"text\":\"XYZ website\",\"href\":\"http://XYZ.com/\"}}}", self.curReview.businessName, self.curReview.reviewType, self.curReview.reviewDetail];
[dialog show];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将以下内容添加为 FBDialog.m / webViewDidFinishLoad 中的第一行:
请记住,Facebook 不会让您“惩罚”用户取消:-)
Add the following as the first line in FBDialog.m / webViewDidFinishLoad :
Bear in mind that Facebook doesn't let you "punish" users for canceling :-)