我正在使用此代码段:
// posting on user timeline using publish_actins permission
try {
// message must come from the user-end
$data = ['message' => 'something...'];
$request = $fb->post('/me/feed', $data);
$response = $request->getGraphEdge()->asArray;
} catch(Facebook\Exceptions\FacebookResponseException $e) {
// When Graph returns an error
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
// When validation fails or other local issues
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
我得到了这个警报,但我成功发布在我的墙上:
“Facebook SDK返回错误:无法转换来自Graph的响应 到GraphEdge因为响应看起来不像GraphEdge。 尝试使用GraphNodeFactory :: makeGraphNode()代替。“
有人能帮助我吗?
答案 0 :(得分:2)
首先,检查您是否要求相关权限(check here)
然后尝试检查 $ request 并查看其中包含的内容。
它通常发生在两种情况中:
1.当您的请求没有回复时(例如,在这种情况下,您的订阅源中没有任何内容)
2.当响应本身是GraphEdge时
祝你好运
答案 1 :(得分:0)
您必须将 $ response 更改为此代码
browser.ShowWindow(NativeMethods.WindowShowStyle.Maximize);
答案 2 :(得分:0)
试试这个
$请求 - > getGraphEdge();