Category Archives: Facebook

Facebook Login with PHP SDK

Github Home:


Sample code to get login URL:

Sample code to get access token

Sample code to get long live token

Get login user data


Please be aware, that there are issues when using the Facebook SDK together with Guzzle 6.x. php-graph-sdk v5.x only works with Guzzle 5.x out of the box. However, there is a workaround to make it work with Guzzle 6.x.

Brand Rules

User click cancel and redirect back with some params



  1. Facebook SDK for PHP
  2. Login button:——–
  3. Permissions
  4. Possible problem

Product Catalog for Facebook

Use XMLWriter

Generate Facebook Product Catalog Feed (XML)

Facebook Doc:

CodeIgniter XML Helper:

Sample Code:



  1. 中繼標籤必要
  2. 設定圖片寬高(否則第一次預覽圖片不會顯示)