facebook - 无法在 Facebook 提要对话框(直接 URL)上添加带有 url 参数的图片

标签 facebook url parameters dialog feed

我想知道如何在这个例子中向我的图片 URl 添加参数:

https://www.facebook.com/dialog/feed?app_id=...&link=...&picture=www.blablabladotcom?parameter1=1&parameter2=2&name=...&caption=...&description=...&redirect_uri= ...

我尝试使用 %26 编码,但没有显示图片。 奇怪的是,当我在 redirect_uri 参数上尝试 %26 时,它工作正常。 关于这个的任何提示??

最佳答案

您需要正确编码所有部分(下面的示例 Java 脚本代码):

var _FBAPPID = "xxxxxxxxxx", // your app ID (mandatory)
    _name = "name",
    _text = "text",
    _link = "link",
    _picture = "http://cdn2.insidermonkey.com/blog/wp-content/uploads/2012/10/facebook4-e1349213205149.jpg", // some google image - replace it
    _caption = "caption",
    _redirect_uri = "http://google.com" // this URL must be from within the domain you specified in your app's settings

var _params = "&name=" + encodeURIComponent(_name)
    + "&description=" + encodeURIComponent(_text)
    + "&link=" + encodeURIComponent(_link)
    + "&picture=" + encodeURIComponent(_picture)
    + "&caption=" + encodeURIComponent(_caption)
    + "&redirect_uri=" + encodeURIComponent(_redirect_uri);

var _href = "http://www.facebook.com/dialog/feed?app_id=" + _FBAPPID + _params + "&display=touch";

我还添加了 display=touch,因为我只为移动设备使用直接 URL。

来源是here .

关于facebook - 无法在 Facebook 提要对话框(直接 URL)上添加带有 url 参数的图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14927619/

相关文章:

facebook - 如何在 flutter 中使用 facebook 执行 firebase 身份验证

c# - 如何在 asp.net c# 中获取所有 url 参数及其值的列表?

azure - Web 事件 ADF 中的参数化授权凭据

.net - Internet Explorer 在查询字符串中遇到特殊字符问题

parameters - SSRS 2008 : Some Multi-Value Paramaters Blank/Unselectable When Creating Subscriptions

javascript无法使用ajax参数发送 '+'字符

facebook - 获取 friend 列表并了解他们是否安装了我的应用程序

ios - Swift 3 Facebook 登录

xcode - 将按钮连接到应用程序委托(delegate)

java - 发送重定向时强制浏览器从 URL 中删除#hash