facebook-php-sdk

Failed to connect to graph.facebook.com port 443: Network unreachable

我的未来我决定 提交于 2019-12-30 09:28:08
问题 <?php session_start(); //included file and use $app_id = 'xxx'; $app_secret = 'xxx'; FacebookSession::setDefaultApplication($app_id, $app_secret); $helper = new FacebookRedirectLoginHelper("`http://example/facebook4.0`/", $app_id, $app_secret); try { $session = $helper->getSessionFromRedirect(); } catch(FacebookRequestException $ex) { } catch(Exception $ex) { } $loggedIn = false; if (isset($session)) { if ($session) { $loggedIn = true; try { //logged here and get data $user_profile = (new

Facebook PHP-SDK with CodeIgniter not returning $_REQUEST['signed_request']

强颜欢笑 提交于 2019-12-30 06:55:50
问题 class Example extends CI_Controller { function __construct() { parent::__construct(); } function index() { $this->load->library('facebooklib'); $user = $this->facebooklib->getUser(); if ($user) { try { $data['user_profile'] = $this->facebooklib->api('/me'); } catch (FacebookApiException $e) { $user = null; } } var_dump($_REQUEST); if ($user) { $data['logout_url'] = $this->facebooklib->getLogoutUrl(); } else { $data['login_url'] = $this->facebooklib->getLoginUrl(); } $this->load->view('view',

PHP Facebook SDK / Graph API - How do I include symbols, eg ©, in a wall post?

最后都变了- 提交于 2019-12-29 07:46:10
问题 How do I post symbols (eg. ©) in a wall post using the graph api? Html entities (eg. &copy;) aren't parsed in facebook. 回答1: All large text fields are utf-8, use the actual character used to represent it which is U+00A9 If you have HTML entities you can decode with html_entity_decode() $utf8_text = html_entity_decode("test © foo", ENT_COMPAT, "UTF-8"); 来源: https://stackoverflow.com/questions/7796603/php-facebook-sdk-graph-api-how-do-i-include-symbols-eg-in-a-wall-post

PHP SDK 3.1.1 getUser() sometimes return 0

给你一囗甜甜゛ 提交于 2019-12-29 06:48:08
问题 This is driving me crazy >=( $facebook->getUser() works well sometimes, but sometimes returns 0 Here is my code: require 'fbapi/facebook.php'; $facebook = new Facebook(array( 'appId' => 'xxx', 'secret' => 'xxxxx', )); $user = $facebook->getUser(); the appId and secret are the correct ones. Which could be the reason that getUser sometimes it returns 0??? 回答1: It's more than likely something on Facebook's end (devs have gone through this before a while back). If $user returns null or 0, simply

What's method for checking user fan of a page in GRAPH API?

你说的曾经没有我的故事 提交于 2019-12-29 03:22:10
问题 In graph api, Pages.isFan method not working, what's method for checking user fan of a page in graph api? Thanks. 回答1: UPDATE 2: To check if the current user is a fan of the Facebook page on landing at your tab check this answer. UPDATE: You can use the likes connection to check if a user is a fan of a page: https://graph.facebook.com/me/likes/PAGE_ID &access_token=ACCESS_TOKEN This would return either an empty data array: Array ( [data] => Array ( ) ) Or if fan: Array ( [data] => Array ( [0]

Just a query about the access_token [duplicate]

两盒软妹~` 提交于 2019-12-26 04:21:50
问题 This question already has an answer here : Closed 7 years ago . Possible Duplicate: How to access fb access token form server running program ( python ) I have made a app that allow me to login and store the fbuid and some other things as i'm just test things out. I have started to make a php commandline program that also uses the php-sdk as my web app does. The only problem is that as the php commandline program runs outside the browser it does not have access to the session to pickup the

Redirect to Facebook page tab after authentication

一个人想着一个人 提交于 2019-12-25 18:31:38
问题 I have a facebook page where I have added a tab of my application. I use to check that the user is authenticated or not using the following code:- <?php $app_id = "MY APP ID"; $canvas_page = "MY CANVAS PAGE"; $auth_url = "https://www.facebook.com/dialog/oauth?client_id=" . $app_id . "&redirect_uri=" . urlencode($canvas_page); $signed_request = $_REQUEST["signed_request"]; list($encoded_sig, $payload) = explode('.', $signed_request, 2); $data = json_decode(base64_decode(strtr($payload, '-_', '

Posting to facebook company page with cron php server side [closed]

谁都会走 提交于 2019-12-25 18:29:15
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I am looking to update a facebook company page directly using cron and php. Can anyone shed some light on the simplest current correct method of generating a page access token then extending that so that I may

Can't login to website using facebook's api's

对着背影说爱祢 提交于 2019-12-25 07:57:55
问题 I have some php code which worked nicely on my old server. I have moved the php code to a new server, and now I can no longer use the facebook api's to log into my site using a facebook login. Here is a screenshot of what happens on the new server: Larger version here. I have checked apache's error.log file and I see no error messages. Why would this be happening on a new server? 回答1: There are many reasons for this check that domains match in code and in settings check that urls match in

Codeigniter login with facebook nothing happens

╄→гoц情女王★ 提交于 2019-12-25 07:49:00
问题 I want to create a login with Facebook in my website. I found a code in the internet that made it simple loading the library of Facebook php sdk. I tried the code but it doesn't work in me. Please help me how to do login with facebook in codeigniter. Here is the code : <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); require_once( APPPATH . 'libraries/facebook/src/facebook.php' ); class FacebookApp extends Facebook { var $ci; var $facebook; var $scope; public