Facebook Connect iPhone StreamDialog 委托dialogDidSucceed

发布于 2024-08-22 19:43:02 字数 324 浏览 5 评论 0原文

我使用 FBStreamDialog 让用户在他们的新闻源上发布内容。

[fbStreamDialog 显示];

弹出对话框视图后,用户可以按取消提交该消息。

现在...我的问题是两个按钮都关闭对话框视图并调用委托方法dialogDidSucceed

如何查明按下了哪个按钮? 这对我来说非常重要,任何有用的建议都会非常好!

谢谢,约翰

I use FBStreamDialog to let users publish on their news feed.

[fbStreamDialog show];

makes the dialog view popup, the user can press cancel or submit that message.

Now...my problem is that both buttons close the dialog view and call the delegate method dialogDidSucceed.

How do I find out which button was pressed?
Its very important for me to know, any useful advice would be reaally really nice!

Thanks, John

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

甜心小果奶 2024-08-29 19:43:02

好吧……不想放弃。以防万一其他人遇到同样的问题..

如果您不介意对 fbconnect 原始代码进行轻微修改 - 打开 FBDialog.m 并将以下行添加到 -(void)webViewDidFinishLoad...

[_webView
stringByEvaluatingJavaScriptFromString:@"document.getElementById('cancel').onclick
= 函数 onclick(事件) { window.location.href =
'fbconnect:取消'; }"];

这将调用dialogDidCancel委托方法而不是dialogDidSucceed。

干杯。

ok... didnt want to give up. just in case somebody else gets the same problem..

if you do not mind making a slight modification to the fbconnect original code - open FBDialog.m and add the following line to -(void)webViewDidFinishLoad...

[_webView
stringByEvaluatingJavaScriptFromString:@"document.getElementById('cancel').onclick
= function onclick(event) { window.location.href =
'fbconnect:cancel'; }"];

this will call the dialogDidCancel delegate method instead the dialogDidSucceed.

cheers.

奢望 2024-08-29 19:43:02

应该有按钮索引,以便您可以识别按下了哪个按钮。

there should be button index so that you can recognize which button was pressed.

千鲤 2024-08-29 19:43:02

我询问了 facebook connect 开发团队并得到了以下答案:

我们目前没有透露是什么按钮
用户点击以避免
出版行为的激励。
DidSucceed 只是让您知道
对话框正确运行,FB将
发表或不发表这个故事
适当地。

I asked the facebook connect developer team and got the following answer:

We don't currently reveal what button
the user clicked in order to avoid
incentivization of publishing actions.
The DidSucceed just lets you know the
dialog was run properly, and FB will
publish or not publish the story
appropriately.

噩梦成真你也成魔 2024-08-29 19:43:02

同样的问题,这对我有用。

  • (void)dialogCompleteWithUrl:(NSURL *)url {
    if (![[url AbsoluteString] isEqualToString:@"fbconnect://success#="])
    {
    // 你的消息
    }
    }

Same problem, this worked for me.

  • (void)dialogCompleteWithUrl:(NSURL *)url {
    if (![[url absoluteString] isEqualToString:@"fbconnect://success#="])
    {
    // your msg
    }
    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文