php,facebook,facebook-php-sdk,composer-php
Version 4+ of the PHP SDK requires PHP 5.4+. If you cannot upgrade your PHP version, you'll have to use the older SDK, "facebook/php-sdk" edit by Clint C.: Fosco was right. Due to having multiple versions of PHP installed I had to specify which version for composer to use. To...
php,facebook-php-sdk,server-side,http-error,ajax-request
PHP didn't support the shorthand arrays as you're currently using until 5.4. http://php.net/manual/en/migration54.new-features.php, http://php.net/manual/en/language.types.array.php Here's your updated code which should work and be forwards compatible with 5.6. <?php error_reporting(E_ALL); ini_set('display_errors', 1); $l = mysql_connect ( "localhost" , "myserver" , "mypass" ) or die("Error connecting:<BR><BR>".mysql_error()); mysql_select_db( "mydb" ) or die("Error getting...
php,facebook,facebook-graph-api,facebook-php-sdk,graph-api-explorer
You should use GET /{page_id}/posts instead of GET /{page_id}/feed if you just want to Page's own posts. See https://developers.facebook.com/docs/graph-api/reference/v2.2/page/feed/ /{page-id}/posts shows only the posts that were published by this page. ...
Here is why you have to have use again in your second file. Read the last line. Scoping rules for importing Scoping rules for importing The use keyword must be declared in the outermost scope of a file (the global scope) or inside namespace declarations. This is because the importing...
facebook,facebook-graph-api,facebook-javascript-sdk,facebook-php-sdk
There is no way to implement this with the Graph API. Public Post Search was removed and the Graph Search is only available on facebook.com.
php,facebook,facebook-graph-api,facebook-php-sdk
I got the solution using facebook extended profile management http://developers.facebook.com/docs/authentication/permissions You can do this if you are using Facebook, connect by passing scope=email in the get string of your call then to the Auth Dialog. It is in the Facebook doccumentation...
php,facebook-graph-api,facebook-php-sdk,facebook-login
I found out that it was a problem with the php code. I utilised an encryption algorithm which takes a lot longer to run on the production server due to different system hardware and times out.
facebook,facebook-javascript-sdk,facebook-php-sdk
You can either use PHP SDK or Javascript SDK or No SDK or any combination! It's flexible, it's on you how you like to code. But since you are using JS SDK for login, if you wish you may use only JS SDK for all the functionalities on your app!...
php,facebook,facebook-graph-api,facebook-php-sdk
Step 1: You can upload the photo to the facebook with the API /photos (this will upload a photo to your album)- API: \POST /me/photos Parameters: 'source' => //The photo, encoded as form data, 'no_story' => true, // no story will be generated on uploading the photo 'message' => //optional...
php,facebook,facebook-graph-api,facebook-javascript-sdk,facebook-php-sdk
You are not asking for any additional permissions, of course you don´t get email or other specifics without authorizing with the needed permissions. Check out this page to find out how to ask for additional permissions in the authorization process: https://developers.facebook.com/docs/reference/php/facebook-getLoginUrl For example, if you want to get the email...
It is your web browser that should set the HTTP_REFERER header not Facebook itself. When your site is being linked or redirected from a HTTPS site, the browser will not set a referrer.
facebook-graph-api,facebook-php-sdk,facebook-events
No, it´s not possible to create events with the Graph API anymore, as you pointed out. You need to create events manually.
facebook,facebook-graph-api,facebook-php-sdk,facebook-graph-api-v2.3
The permissions offline_access and publish_stream are deprecated, thus cannot be requested anymore. publish_stream can be replaced by publish_actions, offline_access is gone. See https://developers.facebook.com/docs/facebook-login/permissions/v2.3#reference ...
php,facebook,facebook-graph-api,facebook-php-sdk
I believe you need to JSON encode the object parameter like so: $graphObject = ( new FacebookRequest( $this->facebookSession, 'POST', "/me/objects/{$objectType}", [ 'object' => json_encode([ 'title' => $title, 'image' => $image, 'url' => $url, 'description' => $description, 'site_name' => $this->siteName ]) ] ) )->execute()->getGraphObject(); ...
You have two questions in 1 question: Can I get public information without Facebook login: Yes, that is possible: You can use the Graph explorer to check that out https://developers.facebook.com/tools/explorer/ You will get basic information, like name, first_name, gender and locale Question 2: Can I get the Facebook ID without...
php,facebook-graph-api,facebook-php-sdk
You should be using composer to include the SDK into your code (it makes this all really simple). There is a walkthrough of how you should set up composer, where to get it, and how to use it on the Github README. https://github.com/facebook/facebook-php-ads-sdk http://getcomposer.org - You can read more about...
php,facebook,facebook-graph-api,facebook-php-sdk
I found the solution here I did not code in php for some time now and things have changed. use Facebook\FacebookSession; is not enough. You need to add a require_once too. require_once( 'Facebook/FacebookSession.php' ); Edit: for a more detailed solution, please checkout the answer below....
php,facebook,facebook-graph-api,facebook-php-sdk
You need to make your app public, on top of Status&Review tab in app dashboard. As long as an app is in development mode, everything it “creates” on Facebook is only visible to app admins/developers/testers. (This does not require to submit your app for review, since you will only be...
php,facebook,facebook-graph-api,facebook-php-sdk
To redirect from the app you need to give the url of the website you in the following way you need to include script: if (isset($_REQUEST['submit'])){ //retrieve form data here $name = $_REQUEST['name']; //save data to database or do other tasks } //now redirect user header ("Location: http://apps.facebook.com/yourapplicationurl"); exit; ...
php,facebook,facebook-graph-api,facebook-php-sdk
It belongs in your last else block: ... else { $loginUrl = $helper->getLoginUrl(array( 'scope' => 'email' )); header("Location: ".$loginUrl); } ...
facebook,facebook-graph-api,permissions,facebook-php-sdk
It means you are executing an HTTP POST instead of an HTTP DELETE in the raw API call. Only an HTTP POST to /me/permissions will give that error. A guess might be the extra space in your call for DELETE might be sending a POST instead $request = new FacebookRequest($this->session,...
facebook,facebook-graph-api,facebook-php-sdk
If you have casted the response as a GraphObject by using one of the following two methods: // Get the response typed as a GraphLocation $loc = $response->getGraphObject(GraphLocation::className()); // or convert the base object previously accessed // $loc = $object->cast(GraphLocation::className()); You can use the Get properties of the graph object,...
php,facebook,facebook-graph-api,facebook-php-sdk
As WizKid has pointed out - I was not using a page token - just the token for the page admin. Simply doing the following sort out the issues: $page_access_token = (new FacebookRequest( $session, 'GET', '/'.$page_id, array( 'fields' => 'access_token' ) ))->execute()->getGraphObject()->asArray(); $params['access_token'] = $page_access_token['access_token']; ...
php,facebook,facebook-graph-api,laravel,facebook-php-sdk
I found the mistake ... The call is supposed to be as follows $postMessage = json_decode( $fb->request ( "/me/feed?access_token={$_SESSION['facebook_access_token']}", 'POST', array ( 'message' => 'This is a test message' ) ), true ); The route is supposed to be first and then the POST....
php,facebook,facebook-graph-api,facebook-php-sdk
It's true that the PHP SDK doesn't provide anything to deal with these links and the documentation doesn't document that either. However the API gives all the information you need in the description field itself, so here is what you could do: $description = "Live concert with @[66961492640:274:Moonbootica] " ....
facebook,facebook-graph-api,facebook-php-sdk
No, FB.api just does the call, there is no confirmation implemented in the API. You would have to do that on your own before calling FB.api.
php,facebook,facebook-graph-api,facebook-php-sdk
There are several issues about getting the same result with the Graph API instead of FQL: There's no permalink field You can't explicitly specify the attachments to be large You can't apply an ordering. Default ordering should be by created_time though To specify the time filter, you can use the...
You need to make sure you include those classes in your code: require_once( 'Facebook/HttpClients/FacebookHttpable.php' ); require_once( 'Facebook/HttpClients/FacebookCurl.php' ); require_once( 'Facebook/HttpClients/FacebookCurlHttpClient.php' ); use Facebook\HttpClients\FacebookHttpable; use Facebook\HttpClients\FacebookCurl; use Facebook\HttpClients\FacebookCurlHttpClient; ...
php,facebook-graph-api,facebook-fql,facebook-php-sdk,facebook-graph-api-v2.3
Have a look at https://developers.facebook.com/docs/graph-api/reference/page#Reading https://developers.facebook.com/docs/graph-api/using-graph-api/v2.3#fields https://developers.facebook.com/docs/graph-api/using-graph-api/v2.3#search You can specify the desired result fields according to the fields which are available for the respective object. For example...
php,facebook,codeigniter,facebook-graph-api,facebook-php-sdk
To post to a Page "as Page", you need to authorize the user with "publish_pages" and you need to use a Page Token. Try to add publish_pages to your permission list: $config['facebook']['permissions'] = array( 'email', 'user_location', 'user_birthday', 'publish_actions', 'publish_pages', 'manage_pages', 'public_profile', ); ...
facebook-graph-api,facebook-fql,facebook-php-sdk,facebook-access-token
You can´t get the location of friends at all. Friend permissions have been removed for privacy reasons, you can only get data of users who authorized your App too. Check out the changelog for more information: https://developers.facebook.com/docs/apps/changelog That being said, there are different Access Tokens. You can get an App...
facebook,session,cakephp,facebook-php-sdk,cakephp-2.5
I have found a solution. The problem is Safari cookie policy, user has to change to allow all cookies in their Safari settings. But I have figured out that if I first reload the page outside the facebook iframe and set the session there, the session remains the same even...
php,facebook,facebook-php-sdk,scrape,achievements
OK, I've figured this out, basically I had 2 dynamic URLS for achievements achievementDescription.php achievementContent.php achievementDescription.php was used to register all achievements with facebook a few years ago. Contained within the meta tags was: <meta property="og:url" content="http://example.com/achievementContent.php?aid=<?=$aid?>"/> The strange thing is that achievementContent.php never actually existed, having been misspelled in...
facebook,facebook-graph-api,permissions,facebook-php-sdk,facebook-fanpage
You need to use the GET /{page_id}/feed endpoint (https://developers.facebook.com/docs/graph-api/reference/v2.0/page/feed/). There's no /{page_id}/home for pages, see https://developers.facebook.com/docs/graph-api/reference/v2.0/page/#edges...
facebook,facebook-graph-api,facebook-javascript-sdk,facebook-php-sdk
This issue apparently to be a bug. I have assigned this into facebook developers and now they taking care of it. tracking at: https://developers.facebook.com/bugs/1512426199028095...
php,facebook,facebook-graph-api,facebook-php-sdk
Use field expansion, just one API call: /me?fields=name,picture.width(500).height(500),birthday API Explorer test: https://developers.facebook.com/tools/explorer/?method=GET&path=me%3Ffields%3Dname%2Cpicture.width%28500%29.height%28500%29&version=v2.2 More information about field expansion: https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#fieldexpansion Batch Requests would be another solution, although not a very good one in that case because they are a lot more complicated (more code, more things to consider)...
php,facebook,facebook-graph-api,facebook-php-sdk,facebook-graph-api-v2.0
I would use the Graph Explorer here to see what you can/should get back: https://developers.facebook.com/tools/explorer/ email is listed under the Extended Permissions tab. How did you log the user in? You should pass in the scopes including 'email' to the getLoginUrl method....
php,authentication,facebook-javascript-sdk,facebook-php-sdk
There are several approaches: Use a remember me cookie similar to a normal form login. To increase security measures you might want to perform a check with Facebook API if the user is the same: Relate the Facebook OAuth token and the "remember me" cookie token in your database. When...
php,facebook,facebook-graph-api,facebook-php-sdk
There is no way to renew a User Token without User interaction. If that would be possible, the whole point of short living Tokens would be void. You can only use Extended User Tokens, they are valid for 60 days. Detailed information about Access Tokens can be found in the...
facebook-graph-api,facebook-php-sdk
I found the Solution. The reason I did not get all the information about the ads is because in Facebook with the objective of Mobile or App Install all the Info is Stored in Object "Unpublished Page Posts". for retrieving the info: 1) get Ad Creative as written in Facebook...
php,facebook,facebook-graph-api,laravel-4,facebook-php-sdk
Edit: @ceejayoz 's answer help me a lot. i was working on the wrong path. but the main problem was @. if ceejayoz did not show me that, may be i was going to spend many more time to figure it out. if there was a way to accept two...
php,facebook-graph-api,facebook-php-sdk
You can use /feed?ids=89641180016,93811111500 (see doc: Making Multiple Requests)
php,facebook,facebook-graph-api,facebook-php-sdk
No, it´s not possible. But you would not be allowed to use the email in any way, so it would be pointless to retrieve all the emails. You are not even allowed to store it without approval of each user.
facebook-graph-api,facebook-php-sdk
This has been fixed facebook development team... Hope this helps others too.. with same issue..... :) https://developers.facebook.com/bugs/449167695235902/
php,facebook,http,facebook-graph-api,facebook-php-sdk
You are correct in assuming that real-time updates for pages require admin access to the page to work. You need a page access token to be able to subscribe to updates for a specific page, and such a page access token you can only get from users that have admin...
php,facebook,permissions,facebook-php-sdk,facebook-oauth
The way you're asking for permissions is incorrect. You should change your code to this instead: $params = array( 'email', 'publish_actions' ); $helper = new FacebookRedirectLoginHelper( $weburl ); $loginUrl = $helper->getLoginUrl( $params ); The parameter $params passed to getLoginUrl is an array of permissions. You don't need to add scope...
php,facebook,facebook-graph-api,facebook-php-sdk
I'm doing this in php in order to get all the likes: public function getLikes () { $likes = array(); // Custom method! Get the session however you like $session = $this->getSession(); $request = new FacebookRequest( $session, 'GET', '/me/likes' ); do { $response = $request->execute(); $graphObject = $response->getGraphObject(); $some_likes =...
You can´t execute ANY code in a Facebook post. Not PHP, not JavaScript. If you want to schedule a post, you will have to add the final text. You can also schedule the post on your own though, and post it with a cron job and some new data.
php,facebook,facebook-graph-api,drupal,facebook-php-sdk
Solved the problem finally. Turns out drupal is changing the & in url for GET requests to & . Related to this .
facebook,facebook-javascript-sdk,facebook-php-sdk
There are very less chances that you'll get email without asking for its permission as a public info. You gotta ask for permission email to get one. But still there could be chances (3-4 in 100) that you'll not get email even when user gave you the permission and you...
php,facebook,rest,facebook-graph-api,facebook-php-sdk
I submitted a bug to their github.
facebook,facebook-graph-api,facebook-php-sdk
That would be user_status. read_stream would also be a possibility, but it would get you access to friend posts too and it will most likely not get approved by Facebook. But keep in mind that incentivizing posts is not allowed, so there is most likely no serious application for checking...
facebook,facebook-graph-api,facebook-fql,facebook-php-sdk
Don't use FQL. It been deprecated and will stop working. Use the Graph API instead and do /me/accounts as explained at https://developers.facebook.com/docs/graph-api/reference/v2.2/user/accounts
php,facebook,facebook-graph-api,facebook-php-sdk
$data['data'] is an array. So you have to call like below var_dump($data['data'][0]['name']); To print all the names you have to loop thorugh the data for($i=0; $i<count($data['data']); $i++) { var_dump($data['data'][$i]['name']); } ...
php,rest,symfony2,facebook-php-sdk,fosrestbundle
Ok I found an answer to this. As my array also had an object as value, the serializer was returning empty json object while returning the response to json. So to solve that I checked whether the key is object or not foreach($options as $t){ if(isset($graphObject[$t])) // $pageInfo[$t] = gettype($graphObject[$t])==...
Just to update to people who are wondering about the same issue, here's a solution: If your page has Page owner (Who has claimed business manager of Facebook page), then no one can add tabs to page not even Admin or Manager of page. Only one person can be a...
php,android,cookies,facebook-php-sdk,facebook-android-sdk
To uniquely identify the user within your app, you should make a request to /me and get the user's id. This is guaranteed to be unique and remain constant for your user/app combination. The access token is not guaranteed to remain constant....
facebook,api,facebook-graph-api,facebook-php-sdk
There is no exact documentation on the search fields endpoint. An educated guess would be that based on the type you can inspect the fields of that page. Example, for type=page the fields available will be listed at https://developers.facebook.com/docs/graph-api/reference/v2.2/page...
facebook,curl,heroku,facebook-php-sdk
cURL is included for Heroku PHP support https://devcenter.heroku.com/articles/php-support#extensions...
facebook-graph-api,facebook-php-sdk
I have had a similar issue and it wasnt the read_stream permission I needed. So I went through permissions in groups testing them out and I figured out what the problem was. You need to have the permission of the item you were tagged in. So in my case I...
php,facebook,facebook-php-sdk,facebook-events
I was getting an error as well, and it was due to 'privacy_type' => 'SECRET' and time formats ... It looks like sending privacy_type => SECRET will throw an OAuth error, but still actually create an event with the correct permissions. ALSO, your dates need to be in ISO-8601 time...
php,webforms,facebook-php-sdk,facebook-graph-api-v2.0
HTML posts are not possible on Facebook, only simple text. And the text always must be 100% user generated, prefilling is not allowed. See the platform policy: https://developers.facebook.com/policy/ That´s just a side note though, because if you post "as Page" on your Page, you are the one who fills in...
php,facebook,facebook-graph-api,facebook-php-sdk
The Facebook SDK's asArray() method is limited as you've discovered. However, you can manually convert an object to an array using the get_object_vars( $object ); function. In your example, you can do something like: $array = get_object_vars( $arrayResult['data'][0] ); This will convert the page Object into an array. The function...
php,facebook,facebook-graph-api,facebook-php-sdk
Instead of a User Token, you need to use a Page Token. Information about all the Tokens and how to get them can be found in the docs: https://developers.facebook.com/docs/facebook-login/access-tokens/ http://www.devils-heaven.com/facebook-access-tokens/ This is how it works: Authorize User with manage_pages and publish_actions Call /me/accounts to get a list of all your...
After have looked for examples and more, I looked that I didn't had added the piece $loginUrl = $helper->getLoginUrl(); header("Location: ".$loginUrl); in the isset($session) else. This because I didn't understand why it was needed and when the session is not defined, I didn't redirect anywhere. if(isset($session)){ echo "Session defined: ".$session;...
facebook,facebook-graph-api,facebook-php-sdk
You can ONLY get the reviews of a Page with a Page Token, so you MUST be Admin of that Page. It´s written in the docs: https://developers.facebook.com/docs/graph-api/reference/page/ratings#Overview A Page Access Token is required for all methods. About all possibilities to read the Page feed, go check out this page in...
php,facebook,laravel-4,facebook-php-sdk,facebook-login
I think I solved my own question... I was thinking about @CBroa's comment above about the error message of invalid redirect happening after successful redirect. This led me to look to see what was happening with the error message. To get the error message I am doing: $e->getPrevious()->getMessage() This led...
php,facebook,laravel,facebook-php-sdk,laravel-5
I fixed the problem by removing setFacebook() and update getFacebook() to this: $helper = new FacebookHandler(url('settings/get_facebook')); try { $session = $helper->getSessionFromRedirect(); } catch( FacebookRequestException $e ) { dd($e); } catch( Exception $e ) { dd($e); } if (isset($session)) { $user_profile = (new FacebookRequest( $session, 'GET', '/me' ))->execute()->getGraphObject(GraphUser::className()); dd($user_profile); } else...
You can apparantly add the list of requested permissions in the getLoginUrl() $loginUrl = $helper->getLoginUrl(["public_profile", "publish_actions", ...]); See https://github.com/facebook/facebook-php-sdk-v4/blob/master/src/Facebook/FacebookRedirectLoginHelper.php#L85 https://developers.facebook.com/docs/php/gettingstarted/4.0.0#authentication Be aware that with v2.0, you need to have your permissions reviewed before you can request them with your app: https://developers.facebook.com/docs/apps/changelog#v2_0_permissions...
Based on your updated code, you likely need just put an if/else in there. EDIT: You are using the method chain version, break it into the non-chained version. Then you can work with exceptions and returned errors using if/else. This is from FB SDK documentation: try { $response = (new...
php,facebook,facebook-graph-api,facebook-php-sdk
1) That is NOT the "Public Feed API", that´s only the Page Feed API. Results are limited to 25 entries, you need to implement paging in order to get more results: https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#paging - just use the "next" value in the result for the next API call to get the next...
php,facebook,facebook-graph-api,facebook-php-sdk,facebook-access-token
You need to upgrade your SDK version to the latest stable version 4.0.12. There have been a whole lot of bug fixes and security updates since 4.0.3. One such bug is related to the session info validation that you're having trouble with. That should hopefully fix your issue. :)
php,facebook,facebook-fql,facebook-php-sdk
Your App needs to be reviewed by Facebook before it goes Live for other users to Login. You do not need to go through Login Review if your app requests these three basic permissions: public_profile user_friends email To ask your app's users for any other permissions, you will need...
php,facebook-graph-api,facebook-javascript-sdk,facebook-fql,facebook-php-sdk
You shouldn't use FQL as it will eventually be depreciated. You can use the taggable_friends API to get a list of friends and indirectly get a estimated friend count. The following tutorial explains the process. PHP Code: // get taggable friends $taggable = (new FacebookRequest( $session, 'GET', '/me/taggable_friends' ))->execute()->getGraphObject()->asArray(); //...
php,facebook,facebook-graph-api,facebook-php-sdk,facebook-opengraph
It totally depends on Facebook, and it keeps changing. Nothing official published yet.
php,facebook,facebook-graph-api,facebook-php-sdk
You need to submit your App to Facebook then Facebook will check and pass you app then you can access you app other account. If you want to check App Functionality you can use Facebook App test user Id. Below I have Explained how to get test user Goto App...
facebook,facebook-graph-api,facebook-php-sdk
all correct. I am not sure about the user click (didn't find that in the documentation https://developers.facebook.com/docs/facebook-login/access-tokens). You should be ready to handle errors in case the token expires earlier or in case of app uninstalls. I check if the token is still valid by getting the user basic info...
facebook,facebook-graph-api,facebook-php-sdk
Just change the URLs and the App Domain in your App Settings and it should be fine. You definitely don´t have to create a new App for the Live Server, you would have to do the review again for that.
facebook,facebook-graph-api,facebook-php-sdk,facebook-graph-api-v2.2
Try this query: /me?fields=photos{album{id},id,from{id},name,created_time,place{id}, comments.summary(1),likes.summary(1),tags{id}} summary needs to be set to 1 in order to retrieve the summary -> total_count data. If your were requesting the comments via the comments edge, then the syntax would be /{object-id}/comments?summary=1 – but for the field expansion syntax you are using, comments.summary(1) must be...
php,facebook,facebook-graph-api,facebook-php-sdk
The FacebookSession class has a method getToken – so once you’ve gone through the login flow successfully, it will give you the user’s access token. As for checking if a token is still valid, it has a validate method as well. And checking the token for validity is possible without...
facebook,facebook-graph-api,facebook-php-sdk
Use the /me/friends endpoint, and var_dump the result. You will find total_friends in it, with the total number of friends. You can read more about it in the changelog: https://developers.facebook.com/docs/apps/changelog#v2_1_new_features
php,arrays,facebook-graph-api,facebook-php-sdk,facebook-app-requests
Resolved Snippet $FB_User_Interests_Movies = (new FacebookRequest( $sess, 'GET', '/me/movies' ))->execute()->getGraphObject()->asArray(); foreach($FB_User_Interests_Movies['data'] as $key) { echo $key->name.'<br />'; } How I resolved Many things are in the Facebook Graph API alike this so I expanded research to ask how to get user friends and whatnot. This lead me to a YouTube...
php,facebook,sdk,facebook-php-sdk,facebook-sdk-4.0
Try this one, I had the same problem as you: http://www.codeproject.com/Tips/777252/Integrating-Facebook-Account-into-a-Log-in-Session
php,facebook,facebook-graph-api,facebook-php-sdk
Turns out I had already selected some items for review before I properly understood the process so I ended up in a state of not being able to make the app live as I had pending review items. I deleted the permissions from the review queue, made the app live...
php,wordpress,facebook,facebook-graph-api,facebook-php-sdk
It depends on what the plugin is about, but in general it´s a good idea to let users create their own App. The user can just enter his App ID and App Secret in the plugin settings. An important benefit is that you are not responsible for it if someone...
php,facebook-graph-api,facebook-php-sdk
The isn't a field called picture for the user object. It's an edge: https://developers.facebook.com/docs/graph-api/reference/v2.2/user/picture $picture_info = (new FacebookRequest($this->session, 'GET', '/me/picture'))->execute()->getGraphObject(); $outputArray[$i]['pictureURL']=$picture_info->getProperty('url'); ...
php,facebook,facebook-graph-api,facebook-php-sdk
You didn't include it in your file... Try this: /* INCLUSION OF LIBRARY FILEs*/ require_once( 'Facebook/FacebookSession.php'); require_once( 'Facebook/FacebookRequest.php' ); require_once( 'Facebook/FacebookResponse.php' ); require_once( 'Facebook/FacebookSDKException.php' ); require_once( 'Facebook/FacebookRequestException.php' ); require_once( 'Facebook/FacebookRedirectLoginHelper.php'); require_once( 'Facebook/FacebookAuthorizationException.php' ); require_once( 'Facebook/GraphObject.php' ); require_once(...
php,facebook,object,facebook-php-sdk
Use the DateTime object's format method: $user_profile->getBirthday()->format('m/d/Y'); See this page for help on constructing the preferred format string....
Facebook doc been extremely stupid. They made it hard for devs to test. You have to Go to developers.facebook.com > Tools > Access Tokens > Grant permission to yourself. That solved the problem ...
user-interface,facebook-php-sdk
'display'=>'popup' = is ok. BUT, you need to open $loginurl in popup(javascript) like : var myfeatures='width='+w+',height='+h+',left='+varLeft+',top='+varTop+',directories=no,location=no,menubar=no,status=yes,titlebar=no,toolbar=no,resizable=no,scrollbars=no'; varTitle='new'; var newWin=window.open(varUrl,varTitle,myfeatures); newWin.focus(); Using 'display'=>'popup' is just layout changes of popup from facebook sdk side. using header('Location: '.$loginurl); will simple redirect to facebook page not in POPUP...
javascript,php,facebook,facebook-javascript-sdk,facebook-php-sdk
Luckily, this is not possible, as it would be pure spam. You would need to authorize every single User with the App, request the publish_actions and user_birthday permissions and store an Extended User Token (that is valid for 60 days). You will never get publish_actions approved by Facebook in their...
php,facebook,facebook-graph-api,facebook-php-sdk
1) Yes, of course you need an App for FB Login and posting and all that stuff. How else would you implement FB Login and how else would you get Facebook IDs or post to a group? 2) You need user_managed_groups and publish_actions, as you can read in the docs:...
facebook,facebook-graph-api,facebook-javascript-sdk,facebook-php-sdk
Facebook has disabled posting to a friends wall completely using the SDK, whether you were granted permission or not. See the February 6, 2013 Update. You should use the JavaScript Feed dialog instead setting the to field of the user you want to message. No. As above. Yes, you...
javascript,jquery,facebook,facebook-javascript-sdk,facebook-php-sdk
I create the logout button that calls FB.logout(): <button id="facebook-logout-button" onclick="FB.logout();" >Facebook logout</button> Then replace $(\".fb-login-button\").empty(); with $("#facebook-logout-button").remove(); ...
facebook,facebook-graph-api,facebook-javascript-sdk,facebook-php-sdk
Yes it is possible. See the documentation here: https://developers.facebook.com/docs/graph-api/reference/v2.3/group/feed Use whichever solution best meets your needs and is easiest for you to code. Both solutions can post to that edge....
jquery,facebook,facebook-javascript-sdk,facebook-php-sdk
The signed_request returns [admin] => 1 if the user is an admin or [admin] => otherwise. There is no true or false value. You can modify your code to something like: <script type="text/javascript"> var page_id = "<?php echo $page_id; ?>"; var user_id = "<?php echo $user; ?>"; var is_admin =...