Facebook Posting API Question

后端 未结 1 834
日久生厌
日久生厌 2021-01-15 10:01

on my site right now I\'m trying to have it post to a users wall a media file.
I had it working on the old api before, but now I\'m trying to get it working on the new

相关标签:
1条回答
  • 2021-01-15 10:48

    First of all, don't confuse APIs with SDKs. The newest PHP SDK is capable of communicating with both the new Graph API and the old REST API.

    And you are using the new SDK, since Facebook::$api_client doesn't exist in the new SDK.

    Secondly, as is usual with most tutorials, they only show you a snapshot of the full features of a system. See here for more details about publishing with the Graph API.

    However, you can still use the old API to publish your message like so

    $facebook->api( array(
        'method'       => 'stream.publish'
      , 'target_id'    => $facebook->getUser()
      , 'message'      => $message
      , 'attachment'   => $attachment
      , 'action_links' => $action_links
    ) );
    
    0 讨论(0)
提交回复
热议问题