2016-05-02 11 views
1

は、私はFacebookのグラフAPI(PHPのSDK)を使用し、ここではFacebookのドキュメントからの例です:facebook:グループフィードの取得方法私はFacebookのグループからのフィードを取得しようとしています

$request = new FacebookRequest(
    $session, 
    'GET', 
    '/{group-id}/feed' 
); 
$response = $request->execute(); 
$graphObject = $response->getGraphObject(); 

$sessionがどうあるべきか?どのように私はそれを宣言することができますか?

facebook docs

+0

https://developers.facebook.com/docs/php/howto/example_retrieve_user_profile](https:// [これを試してみてくださいdevelopers.facebook.com/docs/php/howto/example_retrieve_user_profile);サンプルコードを使用し、ユーザー 'me'をページidに置き換えます。 – itzmukeshy7

答えて

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'); 
関連する問題