php - How to setup Facebook sdk with CodeIgniter to do a Facebook fan Page Tab? -
I am trying the following:
If defined ('basepace') ) Exit ('no direct script entry is allowed'); Class invention enhances CI_Controller {function __construct () {parent :: __ construct (); $ This- & gt; Load-> Library ('facebook', $ this-> config- & gt; item ('fb_config')); } Public Function Index () {$ user_id = $ this- & gt; Facebook-> GetUser (); $ Data ['user_id'] = $ user_id; If ($ user_id) {// We have a User ID, then probably a logged user // If not, we will get an exception, which we handle below I {$ User_profile = $ this-> Facebook- & gt; Try the API ('/ m', 'GET'); Echo "name:" $ user_profile ['name']; } Hold (FacebookApiException $ e) {// If the user is logged out, you may have a // user ID, although the login token is invalid // In this case, we will get an exception, therefore we just // Ask to log in again. $ Login_url = $ this- & gt; Facebook- & gt; Milglin Yule (); Echo 'please & lt; A href = '' $ login_url. ' "$ {E> GetMessage ());}} and {// Any user, Please print a link for user login $ url = $ this-> Facebook-> getLoginUrl (); 'Please' & lt; a href = '' $ login_url. ' "& Gt; Login. & Lt; / A & gt; '; } Die; }} But I am getting this error:
Invalid or no certificate authorization using the bundle information in validating the OAuthException login token Error: User does not have authorized app XXXXXXXXX What can I do to resolve this? Is this the right way that the user is not a question of accessing his profile? And you can add as how some scope JavaScript
{Scope: "Email, Ughr_bridede '}}
It was found that this problem is $ this-> Config- & gt; Items ( 'Fbi_ config') at the array: / P> $ config [ 'fb_config'] = array ( 'appId' = & gt; 'YOUR_APP_ID', 'secret' = & gt; 'YOUR_APP_SECRET', 'fileUpload' = & gt; must be false, // optional 'AllowSignedRequest' = & gt; false, // optional, but is set to false for non-canvas app);
Comments
Post a Comment