使用FBConnect的预填充对话框?

时间:2011-12-11 20:12:09

标签: ios facebook dialog fbconnect

几个月前,我曾经能够用我自己的文本预先填充对话框,这样用户只需要点击分享即可共享该文本,但似乎Facebook已经开始忽略该参数,就像他们说的那样在这篇文章中:https://developers.facebook.com/blog/post/510/

那么还有其他方法可以预先填写用户可以轻松分享的消息吗?

谢谢!

- (void)webViewDidFinishLoad:(UIWebView *)webView 
{
    [super webViewDidFinishLoad:webView];

    if (defaultStatus)
    {
        // Set the pre-filled status message
        [_webView stringByEvaluatingJavaScriptFromString:
         [NSString stringWithFormat:@"document.getElementsByName('feedform_user_message')[0].value = decodeURIComponent('%@')",
          [SHKEncode(defaultStatus) stringByReplacingOccurrencesOfString:@"'" withString:@"\\'"]
         ]
        ];

        // Make the text field bigger
        [_webView stringByEvaluatingJavaScriptFromString:@"document.getElementsByName('feedform_user_message')[0].style.height='100px'"];
    }
}

1 个答案:

答案 0 :(得分:1)

afaik用javascript api预先填充消息框是不可能的,这是一件好事。毕竟它违反了平台政策:

https://developers.facebook.com/docs/guides/policy/application_integration_points/

但是:它仍然应该可以使用php api / sdk。您必须允许用户在发送消息之前编辑消息,并使用textarea或输入字段。只需使用message参数发布/ me / feed。

相关问题