Examples — Facebook Read Eval Log Loop. Codeigniter dan Facebook Graph API | Didats Triadi. Saya ceritanya baru berhasil menggunakan Facebook Graph API dan Codeigniter. Ini saya lakukan karena saya sudah cukup menyerah dengan ribetnya RestAPI Client yang diberikan Facebook. Karena kasus saya agak berbeda, yaitu saya punya beberapa aplikasi terpisah dalam satu instalasi Codeigniter. Setelah melihat-lihat, ternyata ada cara lain yang bisa kita lakukan. Dan yang paling mudah dan cukup aman diimplementasikan adalah Facebook Graph API ini. Catatan ini kiranya bisa berguna buat teman-teman yang lain atau yang mungkin di kemudian hari dapat proyek ini. Yang perlu disiapkan adalah 1 librari dan 1 file controller dan 1 file view.
Sebelum memulai, pastikan beberapa hal berikut ini: Versi PHP yang dipakai adalah versi 5Pengetesan skrip tidak bisa dilakukan di server lokal. Langkah pertama, buat aplikasi Ini adalah langkah wajib. Langkah kedua, unduh librari Curl Librari Curl yang saya pakai ini memang hebat. Langkah ketiga, konfigurasi Index page dibuat kosong. Langkah keempat, htaccess. Integrating Facebook with Codeigniter 2.0 - Key2Market [Business Intelligenece for the real world] I have spent a considerable amount of time over the years trying various ways to integrate Facebook API with Codeigniter. My recent work was a slight adaptation of Elliot Haughin’s library found here . The problem with some of these libraries is that they are fairly outdated and with Facebook move to the new data model significantly reduces their lifespan. Recently, I have dedicated large amount of time seamlessly integrating facebook login with my (fairly sophisticated) login model. The solution was easier then I thought.
But word of caution, this tutorial requires some (good) level of knowledge with Codeigniter. There are a lot of tutorials on how to create facebook apps, do I will not go into it in this blog. First order of business, as usual, is to get the Facebook SDK from GitHub . Create facebook.php in your folder: [php] $config['fb_app_id'] = ‘YOUR APP ID’; $config['fb_api_key'] = ‘YOUR APP KEY’; $config['fb_secret_key'] = ‘YOUR SECRET’; [/php] try { <? <? Login with Facebook in Codeigniter -IdiotMinds. September 11th, 2012. Ncerminara/Facebook-Starter-Kit-for-Codeigniter. Using Facebook PHP SDK 3 with CodeIgniter 2.1. To access the Facebook API, there exists the Facebook PHP SDK to simplify the process. I needed Facebook OAuth in one of my projects using CodeIgniter but had some hard time trying to get it done. I faced a lot of errors, the main one though was that: getUser always returns 0. I found out that this is pretty much popular on stackoverflow and other websites – each proposing different solution.
In this post, I try to organize all the steps and collect them in one place. Facebook App Before starting, make sure you create a new App.Get the APP ID and APP Secret.After creating your App, click Edit Settings or Edit App.In the basic info, add your domain name in the App domain.In the “select how your app integrates with Facebook” click on website and add the same domain you added in step 4 but with as prefix.If you want to test locally, try creating a Virtual Host. Installing Using OAuth In OAuth, the procedure is the following: Create a controller, say Main Controller. Download References. Codeigniter-facebook/application/views/facebook_view.php at master · elliothaughin/codeigniter-facebook.
Using the Facebook API with Codeigniter | jondavidjohn.com. Facebook PHP SDK and CodeIgniter for basic user authentication | Danny Herran. With CodeIgniter 2, plugins are no longer an option. Usually you would just add the Facebook PHP SDK as a plugin and you were good to go, but now, you need to make a little modification to the SDK in order to use Facebook Connect on your CodeIgniter application. Lets start by explaining what is, how to get started and how to authenticate an user using the Facebook API. In this post I will only cover the user authentication process using the Facebook PHP SDK. However, you can do almost anything with the API, just take a look at the official documentation if you have any doubts: All the methods related to the user object (very useful): First of all, a couple of links so you can download the necessary files:CodeIgniter: PHP SDK: (download the 3 files inside the /src/ folder).