Facebook JavaScript SDK 共享对话框无法在移动设备上运行

Facebook JavaScript SDK share dialog not working on mobile

我正在使用 FB JavaScript SDK 在我的网站上分享一些内容。这是代码:

function feedShare() {

FB.ui({
    method: 'share',
    href: 'http://www.domaintoshare.com/index.html?&target=_top&output=embed&id=' + article.id,
    picture: article.picture,
    name: 'article.name',
    description: 'article.description'
}, function(response) {

}

}); }

我可以分享桌面版的文章。如果我点击 FB 上的共享元素,它会重定向到我想要的文章。

问题是它不能在移动设备上运行。当我点击我的分享按钮时,Facebook 应用程序打开,如果我点击分享,link 将被破坏。参数 'id' 不再存在,我该怎么做才能解决这个问题?

我在破坏 link 的 url 上添加了一些额外信息。这是最终代码:

FB.ui({

    method      : 'share',
    href        : 'http://www.domaintoshare.com/index.html?id=' + article.id,
    picture     : article.picture,
    title       : article.name,
    description : article.description

}, function(response) {

}

适用于 Android 和 iOs。