我尝试将一个Feed发布到我的墙上并将其与照片链接(稍后将其链接到粉丝页面的墙上) .
首先,我发布一张照片(它的工作原理) .
我使用以下参数进行照片:
[endpoint] => /me/photos
[message] => my caption
[source] => URL of the Photo
[no_story] => true
然后我将带有照片的Feed发布到我的墙上,然后抛出异常 .
Graph returned an error: Invalid parameter, code: 100
我使用以下参数进行Feed:
[endpoint] => /me/feed
[message] => My Message
[object_attachment] => The id of the photo
如果我删除参数“object_attachment”它的工作原理 . 在文档中,它是一个有效的参数 . 我不知道我做错了什么 .
异常的线:
switch ($code) {
// Login status or token expired, revoked, or invalid
case 100:
case 102:
case 190:
return new static($response, new FacebookAuthenticationException($message, $code));
我使用Graph API Version:2.5 https://developers.facebook.com/docs/graph-api/reference/v2.5/page/feed#publish
Solutions for my problem: 当我使用Graph Explorer时出现以下错误:Stream post URL安全应用程序设置不允许使用一个或多个给定的URL . 它必须与网站URL或Canvas URL匹配,或者域必须是App域之一的子域 . 阅读https://developers.facebook.com/docs/facebook-login/security/以了解有关安全性的应用设置的更多信息 .
在这个链接:https://stackoverflow.com/a/18194474/3303652我找到了一个解决方案 . 转到Facebook应用程序 . 编辑其设置 . 在“高级设置”页面上,禁用"Stream post URL security"选项 .