Feed Dialog - “An error occurred. Please try again later”

冷暖自知 提交于 2019-12-07 22:51:24

问题


I am using the following code to post into users wall.I took this code from developer.facebook. But getting error like "An error occurred. Please try again later" while opening the dialog.

FB.ui(
  {
method: 'feed',
name: 'Facebook Dialogs',
link: 'http://developers.facebook.com/docs/reference/dialogs/',
picture: 'http://fbrell.com/f8.jpg',
caption: 'Reference Documentation',
description: 'Dialogs provide a simple, consistent interface for applications"
 },
   function(response) {
if (response && response.post_id) {
  alert('Post was published.');
} else {
  alert('Post was not published.');
}
 }
 );

Please share ideas to fix this


回答1:


In my case i just set my application at the facebook developer site to be public




回答2:


You have a syntax error on the description: line. this code:

FB.ui(
    {
        method: 'feed',
    name: 'Facebook Dialogs',
    link: 'http://developers.facebook.com/docs/reference/dialogs/',
    picture: 'http://fbrell.com/f8.jpg',
    caption: 'Reference Documentation',
    description: 'Dialogs provide a simple, consistent interface for applic\
ations'
    },
    function(response) {
        if (response && response.post_id) {
            alert('Post was published.');
        } else {
            alert('Post was not published.');
        }
    }
 );

Works on fbrell.com for me.




回答3:


eosgood is right, you have a type-o in your code. However, for others, this might help...

I had the same problem. Things to try:

  • Move the FB.ui javascript to the very end of the page, so it's the last script executed.
  • Doublecheck to make sure you have <div id="fb-root"></div> immediately after the opening body tag.


来源:https://stackoverflow.com/questions/12403869/feed-dialog-an-error-occurred-please-try-again-later

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