facebook-php-sdk

Facebook SDK - Unable to get session

我是研究僧i 提交于 2019-12-13 05:14:13
问题 I'm using CodeIgniter to make a canvas app (this is important), NOT a web app. To my understanding that means I don't have to log the user in like a traditional Facebook Connect app would, by forwarding them onto a Login URL. Facebook should handle that. However, although I get a full signed request, I'm unable to get a session. Below is my code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); use Facebook\FacebookSession; use Facebook\FacebookRequest; use Facebook

Structure of a facebook app with minimal api calls

眉间皱痕 提交于 2019-12-13 04:58:39
问题 I read all the articles on FB regarding PHP login, JS login, Canvas app login, but something remains unclear to me. How does one keep a user logged in after the initial login in JavaScript? You receive a signed_request (which you can use to authenticate the user ONCE (on initial load of a canvas app and on login, right?), let's say you use that information to verify the user server-side. Ok, so far.. But what about subsequent page loads? Basically my question is this.. Can I use the PHP FB

Facebook SDK location field is deprecated for versions v2.3 and higher

我的梦境 提交于 2019-12-13 04:55:56
问题 My website that parses Facebook feed suddenly stopped to work with following error message: " location field is deprecated for versions v2.3 and higher", "type": "OAuthException", "code": 12" I am making only two calls to the Facebook graph: $authToken = fetchUrl("https://graph.facebook.com/v2.2/oauth/access_token?grant_type=client_credentials&client_id={$appId}&client_secret={$appSecret}"); //print_r($authToken); //1 $json_object = fetchUrl("https://graph.facebook.com/v2.2/{$page_id}/feed?{

Facebook PHP page tab app - $_SESSION does not sustain when a user closes their browser window

妖精的绣舞 提交于 2019-12-13 03:15:49
问题 I have a page tab app that is a contest with a like gate. A user likes a page, provides their email address and hits submit to enter the contest. After they enter, I set a session variable $_SESSION['entered'] = '1'; or something similar Once they enter, I show more information on the page(html) and remove the email form. PROBLEM: If the users stays on the page, refreshes it a million times (in the same browser window), the session variable stays and I'm able to tell that the user has entered

php sdk working only in https connections

淺唱寂寞╮ 提交于 2019-12-13 02:10:01
问题 First of all, please do not downvote this post. This is my observance that the php sdk only works in https connections. All the websites which I know(including mine) which have an http connection cannot connect with facebook at all and the $user returns 0 because of which many users are suffering. Please look at a question posted for bounty in stackoverflow -> here. I initially thought that the reason for the problem was blocked ports but now, even in my website $user returns 0. I want to

Facebook API for custom feelings/activity

巧了我就是萌 提交于 2019-12-12 23:20:05
问题 I was searching in the Facebook API documentation, but I can't find what I am looking for. So, what I am looking for is is there an API for creating your custom DO action. For example: John Johson is riding a bike . What I want is to send this ' riding ' as a custom word coming from my app. And also ' bike ' as a custom item as well. The other example I can think about is the running apps in Facebook. When you start to run and connect the app with your Facebook the app can say. John Johson is

“The redirect_uri URL must be absolute” error on Facebook PHP SDK

旧时模样 提交于 2019-12-12 18:19:21
问题 EDIT: I have http://www.example.com (example being my live site) as the Site URL under basic settings. I also have www.example.com and example.com under App Domains . The error I'm getting is: The redirect_uri URL must be absolute My code breaks when I try to login. Here's my code for the getLoginUrl() : <?php $fb = new Facebook\Facebook([ 'app_id' => 'MYAPPID', 'app_secret' => 'MYAPPSECRET', 'default_graph_version' => 'v2.5', ]); $redirectURI = 'http://example.com/login-callback.php';

Facebook app fails to get Session

浪尽此生 提交于 2019-12-12 18:07:24
问题 I'm developing a very basic PHP app on Heroku for Facebook which shows very basic user info like Name, Profile Picture, but the app halts in getToken method ! I've tried the app after logging in my profile still the same message : Here are the codes composer.json {} index.php session_start(); require_once( 'Facebook/FacebookSession.php' ); require_once( 'Facebook/FacebookRedirectLoginHelper.php' ); require_once( 'Facebook/FacebookRequest.php' ); require_once( 'Facebook/FacebookResponse.php' )

Fatal error: Uncaught CurlException: 26: failed creating formpost data thrown

独自空忆成欢 提交于 2019-12-12 17:48:57
问题 I get the following error: Fatal error: Uncaught CurlException: 26: failed creating formpost data thrown in /home/u801961841/public_html/inc/lib/base_facebook.php on line 814 This is the code I used: if ($result === false) { $e = new FacebookApiException(array( 'error_code' => curl_errno($ch), 'error' => array( 'message' => curl_error($ch), 'type' => 'CurlException', ), )); curl_close($ch); throw $e; } curl_close($ch); return $result; } Does anyone know how to solve this problem? 回答1: The

Posting to Facebook fan page feed as user through PHP SDK

时光怂恿深爱的人放手 提交于 2019-12-12 16:51:19
问题 I'm currently facing a problem with the Facebook API that did not occur in summer 2012. In a facebook app of mine, the user is able to type in some text into a textarea which is then posted to a facebook fanpage, just as he went to the page on facebook himself and posted it there. Therefore my app requires the publish_stream extended permissions in order to be able to post onto the pages feed. To settle the post itself I was doing the following: try{ $response_object = $fb->api('XXX/feed',