facebook-php-sdk

PHP - execute web script as command line script?

风格不统一 提交于 2020-01-16 18:48:47
问题 Using PHP version 5.4.28, what I'm trying to accomplish is: A facebook app I have is script "otherevent.php". It should not be publicly visible to any user. It is a backend app that is on the web server, due to Facebook requiring it to have a web address, and the app is run and managed by other scripts. The first script I have to run and manage the app is called "app.php". Ideally all it's supposed to do is execute "otherevent.php", get the output, and echo the output to the screen. Craziness

Get user's facebook info after login using facebook php sdk

冷暖自知 提交于 2020-01-15 12:35:08
问题 I am using Facebook javascript sdk and php sdk to login user to my web app. With javascript I have the login/out working and I can get a logged in user's public facebook details. However, when using php, I am not getting the user's facebook details. To give you some info on the app, when I navigate to a certain page that contains a form, the code checks to see if their logged in. If not, they are given a LoginUrl link. Once logged in, I have the $user_id, so now the user can use the form, but

Facebook Login Button: Can I prevent auto page reload after login?

霸气de小男生 提交于 2020-01-15 07:56:06
问题 I'm trying to upgrade to the 3.1 SDK and running into some problematic behavior: When I log in via the FB login button on my site, the page reloads, despite the fact that I have my own JS method defined in the login button's "onlogin" event. Because the page instantly reloads, it appears that my own "onlogin" script (which checks the FB user and logs them into MY site) seems to get cut off or does not fire. Thus, the user cannot log in to the site. The other side effect is peculiar: After

Using API To Post Links Does Not Include Picture, Title or Meta Desc PHP

允我心安 提交于 2020-01-13 06:11:46
问题 When posting using the API i receive this: https://www.facebook.com/weather.warnings/posts/329128793830700 notice how the Title, thumbnail and meta description are missing from the thing. The following is the code i am using. $allalert = array ( 'oauth_token' => 'not pasting this thanks :P', 'message' => "New $type for $where", 'link' => $url, ); $sendalert = $facebook->api('/125291287567922/links/','POST',$allalert); Referencing how does one post a thumbnail picture to a Facebook /links

Using FQL to retrieve only upcoming birthdays from Facebook API

情到浓时终转凉″ 提交于 2020-01-12 10:17:30
问题 Using the information on FQL and the user table from Facebook's Developer's docs, I've come up with the following code. //build fql string $fql = "SELECT name, birthday_date FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND strlen(birthday_date) != 0 AND substr(birthday_date,0,3) IN ('{$currentMonth}/', '{$nextMonth}/')"; $fql.=$orderBy; $fql.=" LIMIT " . $limit; //query facebook $params = array( 'method' => 'fql.query', 'query' => $fql, 'callback' => '' ); $birthdays =

Facebook Authentication in IE not woking

霸气de小男生 提交于 2020-01-10 05:54:25
问题 Im making a facebook canvas app. To get the users info im using the PHP SDK: <? $app_id = ""; $secret=""; $canvas_page = ""; $auth_url = ""; $facebook = new Facebook(array( 'appId' => '', 'secret' => '', )); // Get User ID $user = $facebook->getUser(); if ($user) { try { // Proceed knowing you have a logged in user who's authenticated. $user_profile = $facebook->api('/me'); } catch (FacebookApiException $e) { error_log($e); $user = null; } } // Login or logout url will be needed depending on

Post Image to the Facebook using Graph API by Giving the source of the file

╄→гoц情女王★ 提交于 2020-01-07 09:25:53
问题 I can upload the image to the facebook acoount using below code: <?php include_once "facebook.php"; ini_set("display_errors",0); //configuring application to post. $app_id = "YOUR_APP_ID"; $app_secret = "YOUR_APP_SECRET"; $post_login_url = "YOUR_REDIRECT_URL"; $code = $_REQUEST["code"]; //Obtain the access_token with publish_stream permission if(empty($code)){ $dialog_url= "http://www.facebook.com/dialog/oauth?" . "client_id=" . $app_id . "&redirect_uri=" . urlencode( $post_login_url) . "

Is there a way to send a conversion event to Facebook using their API?

不问归期 提交于 2020-01-07 07:08:11
问题 I'm working on a SaaS service. There are certain events that happen on the backend which I'd like to use as conversions for Facebook Ads . I figured out there's a way to send a custom event using the Facebook js-pixel . I can't use JS for the events I'd like to track. Maybe it's possible to use something like a good old-fashioned cURL ? Thanks! 回答1: Yes, there is the Offline Conversions API With Facebook's Offline Conversions API you can send your offline conversion events using an offline

Adding a tab to a fan page does not work… error: (#210) Subject must be a page

喜欢而已 提交于 2020-01-06 14:18:15
问题 I'm trying to add a tab to a fanpage using the graph api/PHP SDK and I'm receiving an error : (#210) Subject must be a page I've tried using both the user access_token AND the page access_token but neither work. I've tried using the page id of numerous accounts and still no go. Here is my code: <?php $path="/PAGE_ID/tabs/"; $access_token="ACCESS_TOKEN"; $params = array( 'app_id' => "APP_ID", 'access_token' => $access_token ); try{ $install = $facebook->api($path, "POST", $params); }catch

Problem with post a picture in Facebook Wall with Graph API

限于喜欢 提交于 2020-01-06 05:10:08
问题 I am using the Graph API for Facebook in order to post a message and a picture through my application to the user's wall. I use this one: $facebook->api('/me/feed', 'post', array( 'access_token' => $token, 'message' => $message, 'caption' => $caption, 'description' => $description, 'picture' => $picture, 'cb' => '' ) ); This works fine for around 4-5 months now. Suddenly I cannot post the picture. I haven't changed my code at all, but now I cannot see the image that is supposed to be posted.