如何将参数传递给Facebook,fb://publish/? [英] How to pass parameters to Facebook, fb://publish/?

查看:149
本文介绍了如何将参数传递给Facebook,fb://publish/?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从我的iOS应用程序中打开Facebook应用程序,以便在用户墙上发布帖子.我想提供一个预定义的文本来发布帖子,而且我不知道如何将文本添加到通话中.

From my iOS app, I want to open the Facebook application to make a post in the user wall. I want to give a predefined text to make the post, and I don't know how to add the text to the call.

 NSString *post = [NSString stringWithFormat:@"fb://publish"];
 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:post]];

如何使用"fb://publish/"选项传递文本参数?

How could I pass the text parameters with the "fb://publish/" option?

推荐答案

在Safari中,类似这样的HTML似乎可以正常工作:

From Safari, some HTML like this seems to be working:

<a href="fb://publish/?text=#text#">...</a>

它将打开Facebook应用程序的共享对话框,其中包含预定义的文本,您必须先对其进行编辑,然后才能实际共享它.您还可以在文本中包含URL; Facebook在发布后将其转换为一个简单的链接,但与往常一样,它不会添加该URL上定义的图像或任何其他元详细信息.

It opens up the Facebook application's share dialog with the text predefined, which you have to edit before you can actually share it. You can also include URLs into the text; Facebook converts that to a simple link once posted, but it does not add the image or any other meta details defined on that URL, as usual.

请注意,这将重定向到旧样式的发布屏幕,

Note this redirects to the old style publish screen,

不是3.4版以来Facebook应用程序一直在使用的版本.

not the one the Facebook application has been using since version 3.4.

这篇关于如何将参数传递给Facebook,fb://publish/?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆