Javascript Facebook share dialog with open graph “og:url” not working

本小妞迷上赌 提交于 2019-12-02 11:47:53

问题


I am currently using the javascript Facebook share dialog API version 3.2 as follows:

FB.ui(
  {
        method: "share_open_graph",
        action_type: "og.likes",
        action_properties: {
            object: {
                "og:title": "Test Title",
                "og:description": "Test description here",
                "og:image": "https://url-to-image-here",
                "og:url": "https://google.com"
            }
        }
    },
    (fbResponse: any) => {
        // handle response here.
    }
);

When i include the og:url with a non-empty value, I keep getting the following response when the dialog loads regardless of the url I use:

Facebook response with og:url defined

If I do not define the og:url or assign it an empty string, the dialog loads and shows a preview of the post as expected. However, when I complete the post and view it on Facebook, it will not link to my desired url, since I had to exclude it to make it work.

If anyone else has experienced this issue and knows how to resolve it, please let me know. I have been looking around for a solution for days now and I'm all out of ideas...

来源:https://stackoverflow.com/questions/55930183/javascript-facebook-share-dialog-with-open-graph-ogurl-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!