我正在尝试从facebook组获取提要,我使用了facebook图形API(PHP sdk),这里是来自facebook docs的示例:
$request = new FacebookRequest(
$session,
'GET',
'/{group-id}/feed'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
$session
应该是什么?我怎么声明呢?
答案 0 :(得分:1)
使用此代码制作请求投放图API
$fb = new Facebook\Facebook([
'app_id' => '{app-id}',
'app_secret' => '{app-secret}',
'default_graph_version' => 'v2.2',
]);
// Since all the requests will be sent on behalf of the same user,
// we'll set the default fallback access token here.
$fb->setDefaultAccessToken('user-access-token');
$requestUserName = $fb->request('GET', '/{group-id}/feed');