facebook-php-sdk

How to Read/ Parse Data of Signed_Request from Registration Script in Php 5.1.6

荒凉一梦 提交于 2020-01-02 15:04:41
问题 I'm trying to implement the Facebook registration script. The form is getting submitted fine and the server is receiving the signed request. However, it is not able to read/parse the signed request. I used the script recommended on the registration page https://developers.facebook.com/docs/plugins/registration/ (code below) and all I see for output is: signed_request contents: I have verified that the signed_Request is being received. If I pass it to: http://developers.facebook.com/tools/echo

How to Read/ Parse Data of Signed_Request from Registration Script in Php 5.1.6

霸气de小男生 提交于 2020-01-02 15:04:40
问题 I'm trying to implement the Facebook registration script. The form is getting submitted fine and the server is receiving the signed request. However, it is not able to read/parse the signed request. I used the script recommended on the registration page https://developers.facebook.com/docs/plugins/registration/ (code below) and all I see for output is: signed_request contents: I have verified that the signed_Request is being received. If I pass it to: http://developers.facebook.com/tools/echo

facebook php - how to get album cover photo

跟風遠走 提交于 2020-01-02 07:08:48
问题 I need to get the album cover photo with the PHP SDK (Facebook). I try with: https://graph.facebook.com/[ALBUM_ID]/picture?type=album, but I get a default image... for example... to get profile pic of user https://graph.facebook.com/[USER_ID]/picture?type=square Somebody can tell me the correct way to get cover photo for albums please. thanks. 回答1: You could just use FQL, it is my preferred method and offers a lot of flexibility. This code sample should be what you need: $album_id =

Reading data from Facebook graphObject

白昼怎懂夜的黑 提交于 2020-01-02 01:09:07
问题 A user has accepted my Facebook app. I can now access some of their data. It is returned as a graphObject , which contains something like: Facebook\GraphObject Object ( [backingData:protected] => Array ( [id] => 11111 [first_name] => Bob [gender] => male [last_name] => Builder [link] => https://www.facebook.com/app_scoped_user_id/11111/ [locale] => de_DE [name] => Bob Builder [timezone] => 2 [updated_time] => 2014-02-14T14:35:54+0000 [verified] => 1 ) ) Unfortunately I cannot get at the data

Maximum limit fetching facebook pages with Graph API

此生再无相见时 提交于 2020-01-01 04:31:15
问题 What is the maximum limit for fetching the facebook pages from an account? Let's suppose if a facebook account has more than 200 pages to administer. If I try to retrieve facebook pages of that account using '/me/accounts' edge. Then I get data as well as paging (containing cursors and next , previous page links). What I want to know is If I can set a limit while fetching the facebook pages like '/me/accounts?limit=200' and get all the 200 facebook pages the account has?? I have searched the

Facebook PHP SDK Upload Photos

我的梦境 提交于 2020-01-01 00:23:13
问题 Trying to upload a photo rendered on my server to the facebook album of the user on the fly. Since FB Docs are very,very,very bad (to say the least) I was hoping for someone to show me some good code examples of Graph API calls with the PHP SDK? 回答1: Something like this. try { $facebook->setFileUploadSupport('http://www.example.com/'); $response = $facebook->api( '/me/photos/', 'post', array( 'message' => 'This is my image caption', 'source' => '@/path/to/image' // @-sign must be the first

Facebook PHP SDK Upload Photos

≯℡__Kan透↙ 提交于 2020-01-01 00:22:40
问题 Trying to upload a photo rendered on my server to the facebook album of the user on the fly. Since FB Docs are very,very,very bad (to say the least) I was hoping for someone to show me some good code examples of Graph API calls with the PHP SDK? 回答1: Something like this. try { $facebook->setFileUploadSupport('http://www.example.com/'); $response = $facebook->api( '/me/photos/', 'post', array( 'message' => 'This is my image caption', 'source' => '@/path/to/image' // @-sign must be the first

facebook post on page wall - PHP SDK

◇◆丶佛笑我妖孽 提交于 2019-12-31 01:11:47
问题 I'm trying to create a script that post on a facebook page (as an administrator) a status. This is the script i'm using: try { $access_token = (new FacebookRequest( $session, 'GET', '/' . $pageID, array( 'fields' => 'access_token' ) )) ->execute()->getGraphObject()->asArray(); $access_token = $access_token['access_token']; $page_post = (new FacebookRequest( $session, 'POST', '/'. $pageID .'/feed', array( 'access_token' => $access_token, 'message' => $message, ) ))->execute()->getGraphObject()

Authenticating a FACEBOOK Application - PHP

寵の児 提交于 2019-12-30 13:48:25
问题 i need to authenticate before posting to my own wall, so here is my code function get_app_token($appid, $appsecret) { $args = array( 'grant_type' => 'client_credentials', 'client_id' => $appid, 'client_secret' => $appsecret ); $ch = curl_init(); $url = 'https://graph.facebook.com/oauth/access_token'; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT

Facebook OAuthException: (#1)

不打扰是莪最后的温柔 提交于 2019-12-30 10:13:15
问题 I have a few applications which upload image to user profile. A few hours ago all applications were working fine but now when uploading is requested, it gives this error Fatal error: Uncaught OAuthException: (#1) An unknown error occurred thrown in applications/fb-sdk/facebook.php on line 543 I'm using the following code to publish image. $FILE = "images/$image"; $args = array('message' => 'My msg '); $args['image'] = '@' . realpath($FILE); $data = $facebook->api('/'.$uid.'/photos', 'post',