{"id":15309059,"url":"https://github.com/marcelod/facebook-sdk-v4-codeigniter","last_synced_at":"2025-10-08T16:31:20.368Z","repository":{"id":30526045,"uuid":"34080586","full_name":"marcelod/facebook-sdk-v4-codeigniter","owner":"marcelod","description":"Library for integration of Facebook PHP SDK v4 with CodeIgniter 3","archived":false,"fork":true,"pushed_at":"2015-04-13T03:57:21.000Z","size":94,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-02T08:19:35.442Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://darkwhispering.com","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"darkwhispering/facebook-sdk-codeigniter","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcelod.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":"contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-16T21:06:04.000Z","updated_at":"2015-04-16T21:06:04.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/marcelod/facebook-sdk-v4-codeigniter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelod%2Ffacebook-sdk-v4-codeigniter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelod%2Ffacebook-sdk-v4-codeigniter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelod%2Ffacebook-sdk-v4-codeigniter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelod%2Ffacebook-sdk-v4-codeigniter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcelod","download_url":"https://codeload.github.com/marcelod/facebook-sdk-v4-codeigniter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235731901,"owners_count":19036821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T08:20:13.749Z","updated_at":"2025-10-08T16:31:20.011Z","avatar_url":"https://github.com/marcelod.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Facebook PHP SDK v4 for CodeIgniter\nLibrary for integration of Facebook PHP SDK v4 with CodeIgniter 3\n\n**Version:** 2.0.0\n\n## Requirements\n- PHP 5.4+\n- [CodeIgniter 3](http://www.codeigniter.com/)\n- CodeIgniter session library\n- [Facebook PHP SDK v4](https://packagist.org/packages/facebook/php-sdk-v4)\n- [Composer](https://getcomposer.org/)\n\n## Notice\nFacebook Canvas support is experimental as I have not been able to test or confirm it working. If you test it, please report back if you had success or failure.\n\nThis library do not include or support all available Facebook Graph methods. Any contribution is welcome to add more. But, please read the contributing rules before submitting any pull requests.\n\n## Installation\n1. Download the library files and add the files to your CodeIgniter installation. Only the library, config and composer.json files are required.\n1. In CodeIgniter `/application/config/config.php` set `$config['composer_autoload']` to `TRUE`.\n2. In CodeIgniter `/application/config/config.php`, configure the `Session Variables`.\n3. Update the `facebook.php` config file in `/application/config/facebook.php` with you Facebook App details.\n4. Install the Facebook PHP SDK by navigating to your applications folder and execute `composer install`.\n6. Autoload the library in `autoload.php` or load it in needed controllers with `$this-\u003eload-\u003elibrary('facebook');`.\n5. Enjoy!\n\n## Usage\nThe library download includes a sample controller and views. The example code might not be the best or most beautiful code, but it is there to help you get started quicker.\n\n## Methods\n\n#### logged_in()\nCheck if user is logged\n```php\n$this-\u003efacebook-\u003elogged_in();\n```\n\n#### login_url()\nGet login url. This method will only return a URL when using the redirect (web) login method.\n```php\n$this-\u003efacebook-\u003elogin_url();\n```\n\n#### logout_url()\nCheck if user is logged. This method will only return a URL when using the redirect (web) login method.\n```php\n$this-\u003efacebook-\u003elogout_url();\n```\n\n#### destroy_session()\nShould only be used on the logout redirect url location. This method will unset the Facebook token cookie set by this library only. **This method can not be used to log out a user!**\n```php\n$this-\u003efacebook-\u003edestroy_session();\n```\n\n#### user_id()\nCheck user id.\n```php\n$this-\u003efacebook-\u003euser_id();\n```\n\n#### user()\nCheck user details.\n```php\n$this-\u003efacebook-\u003euser();\n```\n\n#### get_post()\nGet post from users wall.\n*Requires user has approved `read_stream` permission*\n```php\n/**\n* Retrieve a single post from users wall\n*\n* Required permission: read_stream\n*\n* @param   int     $id   Post ID\n*\n* @return  array\n**/\n$this-\u003efacebook-\u003eget_post($id);\n```\n\n#### publish_text()\nPublish a text to users wall.\n*Requires user has approved `publish_actions` permission*\n```php\n/**\n* Publish a post to the users feed\n*\n* Required permission: publish_actions\n*\n* @param   string  $message  Message to publish\n*\n* @return  array\n**/\n$this-\u003efacebook-\u003epublish_text($message);\n```\n\n#### publish_video()\nPublish a video to users wall.\n*Requires user has approved `publish_actions` permission*\n```php\n/**\n* Publish (upload) a video to the users feed\n*\n* Required permission: publish_actions\n*\n* @param   string  $file         Path to video file\n* @param   string  $description  Video description text\n* @param   string  $title        Video title text\n*\n* @return  array\n**/\n$this-\u003efacebook-\u003epublish_video($file, $description, $title);\n```\n\n#### publish_image()\nPublish a image to users wall. This method support externally hosted images **only**.\n*Requires user has approved `publish_actions` permission*\n```php\n/**\n* Publish image to users feed\n*\n* Supports externally hosted images only! No direct upload\n* to Facebook.com albums at this time.\n*\n* Required permission: publish_actions\n*\n* @param   string  $image    URL to image\n* @param   string  $message  Image description text\n*\n* @return  array\n**/\n$this-\u003efacebook-\u003epublish_image($image, $message);\n```\n\n#### Return data format\nMost methods will return an array that include status code and message values so that you can do appropiet actions depending on if, for example, a publishing of a image was successfull or not. A list of more error codes and messages can be found [here](https://developers.facebook.com/docs/graph-api/using-graph-api/v2.3#errors)\n\nExample of returned result for `user()`\n```\nArray\n(\n    [code] =\u003e 200\n    [message] =\u003e success\n    [data] =\u003e Array\n    (\n        [id] =\u003e 3241823947947890785957\n        [email] =\u003e email@email.com\n        [first_name] =\u003e John\n        [gender] =\u003e Male\n        [last_name] =\u003e Doe\n        [link] =\u003e https://www.facebook.com/app_scoped_user_id/3241823947947890785957/\n        [locale] =\u003e en_US\n        [name] =\u003e John Doe\n        [timezone] =\u003e -7\n        [updated_time] =\u003e 2015-04-03T03:22:50+0000\n        [verified] =\u003e 1\n    )\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelod%2Ffacebook-sdk-v4-codeigniter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcelod%2Ffacebook-sdk-v4-codeigniter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelod%2Ffacebook-sdk-v4-codeigniter/lists"}