{"id":1466,"date":"2022-08-30T15:16:46","date_gmt":"2022-08-30T15:16:46","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/19\/public-stream-to-facebooks-user-wall-with-php-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:16:46","modified_gmt":"2022-08-30T15:16:46","slug":"public-stream-to-facebooks-user-wall-with-php-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/public-stream-to-facebooks-user-wall-with-php-collection-of-common-programming-errors\/","title":{"rendered":"Public stream to facebook&#39;s user wall with php?-Collection of common programming errors"},"content":{"rendered":"<p>I build a facebook app with php api, everything work fine just have a problem when i need public a message on user&#8217;s Wall.<\/p>\n<p>my code bellow<\/p>\n<pre><code>$appapikey = \"xxxxxx\";\n$appsecret = \"xxxxxx\";\n$facebook = new Facebook($appapikey, $appsecret);\n$fb_user = $facebook-&gt;require_login();\nif (!$facebook-&gt;api_client-&gt;users_hasAppPermission(\"publish_stream, status_update\")){\n    echo 'Click here to grant permissions to update your status and publish to your stream.';\n\n    try {\n        $facebook-&gt;api_client-&gt;stream_publish($message);\n    } catch (Exception $e) {\n        echo \"Public error\".$e-&gt;getMessage();\n    }\n}\n<\/code><\/pre>\n<p>I had allow Permission for publish_stream but still get error<\/p>\n<pre><code>Uncaught exception 'FacebookRestClientException' with message 'Unauthorized source IP address (ip was: 69.89.31.xxx)'\nStack trace:\n#0 \/home\/flexvnne\/public_html\/facebook\/facebook\/client\/facebookapi_php5_restlib.php(345): FacebookRestClient-&gt;call_method('facebook.users....', Array)\n#1 \/home\/flexvnne\/public_html\/facebook\/index.php(36): FacebookRestClient-&gt;users_getInfo('625757897', 'username')\n#2 {main}\n  thrown in \/home\/flexvnne\/public_html\/facebook\/facebook\/client\/facebookapi_php5_restlib.php on line 1314\n[16-Oct-2009 01:30:53] PHP Fatal error:  Uncaught exception 'FacebookRestClientException' with message 'Unauthorized source IP address (ip was: 69.89.31.xxx)' in \/home\/flexvnne\/public_html\/facebook\/facebook\/client\/facebookapi_php5_restlib.php:1314\n<\/code><\/pre>\n<p>Anyone known way to solved that problem ?<\/p>\n<ol>\n<li>\n<p>It looks like your users_getInfo() call is the one that is failing here, not stream publishing. My guess is check your whitelist\/blacklist in your facebook developer application app settings &#8212; your IP might be restricted.<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-19 13:18:37. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I build a facebook app with php api, everything work fine just have a problem when i need public a message on user&#8217;s Wall. my code bellow $appapikey = &#8220;xxxxxx&#8221;; $appsecret = &#8220;xxxxxx&#8221;; $facebook = new Facebook($appapikey, $appsecret); $fb_user = $facebook-&gt;require_login(); if (!$facebook-&gt;api_client-&gt;users_hasAppPermission(&#8220;publish_stream, status_update&#8221;)){ echo &#8216;Click here to grant permissions to update your status and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1466","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1466"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1466\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}