Search Results

Search found 14989 results on 600 pages for 'facebook api'.

Page 2/600 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Using Perl WWW::Facebook::API to Publish To Facebook Newsfeed

    - by Russell C.
    We use Facebook Connect on our site in conjunction with the WWW::Facebook::API CPAN module to publish to our users newsfeed when requested by the user. So far we've been able to successfully update the user's status using the following code: use WWW::Facebook::API; my $facebook = WWW::Facebook::API->new( desktop => 0, api_key => $fb_api_key, secret => $fb_secret, session_key => $query->cookie($fb_api_key.'_session_key'), session_expires => $query->cookie($fb_api_key.'_expires'), session_uid => $query->cookie($fb_api_key.'_user') ); my $response = $facebook->stream->publish( message => qq|Test status message|, ); However, when we try to update the code above so we can publish newsfeed stories that include attachments and action links as specified in the Facebook API documentation for Stream.Publish, we have tried about 100 different ways without any success. According to the CPAN documentation all we should have to do is update our code to something like the following and pass the attachments & action links appropriately which doesn't seem to work: my $response = $facebook->stream->publish( message => qq|Test status message|, attachment => $json, action_links => [@links], ); For example, we are passing the above arguments as follows: $json = qq|{ 'name': 'i\'m bursting with joy', 'href': ' http://bit.ly/187gO1', 'caption': '{*actor*} rated the lolcat 5 stars', 'description': 'a funny looking cat', 'properties': { 'category': { 'text': 'humor', 'href': 'http://bit.ly/KYbaN'}, 'ratings': '5 stars' }, 'media': [{ 'type': 'image', 'src': 'http://icanhascheezburger.files.wordpress.com/2009/03/funny-pictures-your-cat-is-bursting-with-joy1.jpg', 'href': 'http://bit.ly/187gO1'}] }|; @links = ["{'text':'Link 1', 'href':'http://www.link1.com'}","{'text':'Link 2', 'href':'http://www.link2.com'}"]; The above, nor any of the other representations we tried seem to work. I'm hoping some other perl developer out there has this working and can explain how to create the attachment and action_links variables appropriately in Perl for posting to the Facebook news feed through WWW::Facebook::API. Thanks in advance for your help!

    Read the article

  • Facebook Connect OR Facebook Authorization using OAuth 2.0

    - by AJS
    I want to allow users to sign in using facebook as well to my website, since the recent release of new Facebook stuff, I am unsure which one to use. Previously, Facebook Connect was used. Now we have Facebook authorization feature, using the OAuth 2.0. Please tell me which one to use? and Is Facebook Connect going to be obsolete? I am new to Facebook Development.

    Read the article

  • Getting FBML Error unknown tag "fb:like" error with Facebook app

    - by overture8
    I've been looking at this for ages now and I cant find anything on the net that provides a solution. When trying to use the tag... ...this is embedded on a tab canvas. The 'Like' button appears when using the app locally, however, it doesn't appear when used on the facebook site. I get this error:- FBML Error (line 264): unknown tag "fb:like" I have FBML enabled in the settings. I've also tried using the iframe alternative with no luck. Any ideas? PS.. I'm using CakePHP

    Read the article

  • Facebook PHP SDK and Wordpress Error

    - by Gecko
    I have a developer environment setup with WAMP, Wordpress, and PHPEdit IDE. I use the Facebook, Twitter, and YouTube API's in a sidebar. I'm using Facebook's PHP SDK to display information(no login or admin functions). Since the FB SDK and WP use session_start() I get the following warning: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\wamp\www\dfi\wp-content\themes\DFI\header.php:12) in C:\wamp\www\dfi\wp-content\themes\DFI\api\facebook.php on line 36 I'm trying to figure this out by using the warning output but it doesn't help considering the following. I know about clearing white space and characters before and after <?php ?> and placing session_start() before any http output. I use unix line enders and UTF8 encoding without BOM. My host server is not set up for output_buffering. header.php line 11 to 13 11 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 12 <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes();?>> 13 <head> It looks like the warning comes from inline php code. I don't know what I can do to fix this line. facebook.php line 34 to 37 34 public function __construct($config) { 35 if (!session_id()) { 36 session_start(); 37 } I don't think I can stop either FB or WP from calling session_start() without breaking everything. How do I make Wordpress and Facebook play nicely together without this error?

    Read the article

  • Example to get Facebook Events using sdk v4 from fan page into Wordpress site [on hold]

    - by Dorshin
    Been trying to update to the new FB php sdk v4 for pulling events into my website, but having trouble finding how to do it. I want to pull public event information from a FB "page" using their fan page ID number. For example, a venue that has multiple events. What are the minimal classes I need to "require_once" and "use" to only pull the events (don't need to login)? The site is on Wordpress which doesn't use sessions, so what do I do with the "session_start()" statement? Will it work anyway? Could I get a basic code example of how to get the event info into an array? (I want to make sure I get the syntax correct) So far I've got the below code, but it is not working. session_start(); require_once( 'Facebook/GraphObject.php' ); require_once( 'Facebook/GraphSessionInfo.php' ); require_once( 'Facebook/FacebookSession.php' ); require_once( 'Facebook/FacebookCurl.php' ); require_once( 'Facebook/FacebookHttpable.php' ); require_once( 'Facebook/FacebookCurlHttpClient.php' ); require_once( 'Facebook/FacebookResponse.php' ); require_once( 'Facebook/FacebookSDKException.php' ); require_once( 'Facebook/FacebookRequestException.php' ); require_once( 'Facebook/FacebookAuthorizationException.php' ); require_once( 'Facebook/FacebookRequest.php' ); require_once( 'Facebook/FacebookRedirectLoginHelper.php' ); use Facebook\GraphSessionInfo; use Facebook\FacebookSession; use Facebook\FacebookCurl; use Facebook\FacebookHttpable; use Facebook\FacebookCurlHttpClient; use Facebook\FacebookResponse; use Facebook\FacebookAuthorizationException; use Facebook\FacebookRequestException; use Facebook\FacebookRequest; use Facebook\FacebookSDKException; use Facebook\FacebookRedirectLoginHelper; use Facebook\GraphObject; function facebook_event_function() { FacebookSession::setDefaultApplication('11111111111','00000000000000000'); /* make the API call */ $request = new FacebookRequest($session, '/{123456789}/events','GET'); $response = $request->execute(); $graphObject = $response->getGraphObject(); } So far, not getting anything in the $graphObject and it's throwing this error as well: PHP Fatal error: Uncaught exception 'Facebook\FacebookAuthorizationException' with message '(#803) Some of the aliases you requested do not exist: v2.0GET' in ../Facebook/FacebookRequestException.php:134 After I get something in the $graphObject, I want to add the info to a DB table. This part I am OK on. Thank you for the help.

    Read the article

  • Embedding Facebook Connect In A Facebook Page

    - by Russell C.
    Our site allows users to register using Facebook Connect. We also have a Facebook page. We'd like to include the "Connect with Facebook" button in our page so a user could instantly connect (aka register) and then be forwarded on to their account on our site. I was hoping to use the Static FBML page application and the FBML iFrame tag to simply embed the button but it looks like the iFrame tag isn't allowed in Facebook pages. Facebook Connect uses JavaScript so I'm wondering if there is some kind of trick I could use like popping up a page in a new window that would automatically display the connect dialog box. Any ideas on how I would include a Facebook Connect button on our Facebook page would awesome! Thanks in advance for your help.

    Read the article

  • Facebook App Wall Posting no longer showing in Facebook iPhone App

    - by David Hsu
    I use the GRAPH API with django for Facebook wall postings. Since yesterday, the wall posts only show on the Facebook web app but not the Facebook iPhone app. I tried Yelp, and their postings still show up. How can I debug this? Anyone notice this issue with their Facebook connect? Is this a Facebook algorithm issue. Code for Wall Post: graph = facebook.GraphAPI(access_token) attachment = {"name": name, "link": link, #"caption": "{*actor*} posted a new review", "description": desc, "picture": picture } graph.put_wall_post("",attachment)

    Read the article

  • Facebook insights for websites does not match on-site Facebook button counts

    - by Will
    I use Facebook Insights for websites and Facebook buttons on my site. However, the data reported by the two do not match. It always seems to be the case that the count reported by the buttons is significantly higher than the count reported in Facebook Insights. For example, this page http://www.appmyworld.com/blog/top-5-iphone-and-ipad-apps-of-the-week-10412.html has a count of 52 for Facebook which is made up of 19 likes, 21 shares and 12 comments according to AddThis and confirmed by http://sharedcount.com However, going into Facebook Insights for my website and looking at that specific page it shows only 4 total actions which is made up of 1 like and 3 shares. At the very least I would expect it to show a total count of 40 made up of 19 likes and 21 shares (I'm not sure it would track the 12 comments). Any thoughts on why this may be happening? My concern is if our website is not getting credit for the Facebook activity?

    Read the article

  • Free (Or Cheap) Alternatives For An SSL Certificate For Facebook Apps

    - by mickburkejnr
    In October (from what I remember) Facebook will require HTTPS connections to pages and app's that are hosted away from Facebook. At the moment, it comes up with a popup saying "do you want to turn secure browsing off". I think (as far as I know) that once October comes people won't be able to access these pages any more. Now, I know you have to pay for good SSL certificates. However, for a lot of clients this is just going to be a Facebook page, and not mission critical to their businesses. With this in mind, they may not want to pay for an SSL certificate. I was wondering if there are any free SSL certificates that could do the job? Even if there are no free ones, are there any cheap alternatives? Also, if you do use a free certificate, will it still work in the same way as a paid for certificate?

    Read the article

  • facebook og:image not working [closed]

    - by zeinab
    When I try to post a comment (share link) on an article from my page which is actually a page I am using as an application in Facebook: https://apps.facebook.com/ids_newsletter/, Facebook chooses the feed thumbnail image of the post feed randomly from my page. I tried using below to put a custom image for the post but nothing affected the post thumbnail. So what should I do? <meta property="og:title" content="IDS June Newsletter" /> <meta property="og:description" content="Check this out" /> <meta property="og:image" content="MYSITEURL/Images/logobig.png" /> <meta property="og:image:type" content="image/png" /> <meta property="og:image:width" content="200" /> <meta property="og:image:height" content="200" />

    Read the article

  • Add a wall post to a page or application wall as page or application with facebook graph API

    - by blauesocke
    Hi, I wan't to create a new wall post on a appliaction page or a "normal" page with the facebook graph API. Is there a way to "post as page"? With the old REST-API it worked like this: $facebook->api_client->stream_publish($message, NULL, $links, $targetPageId, $asPageId); So, if I passed equal IDs for $targetPageId and $asPageId I was able to post a "real" wall post not caused by my own facebook account. Thanks!

    Read the article

  • facebook API error : Uncaught OAuthException: Error validating access token.

    - by iyad al aqel
    guys i'm getting this error Fatal error: Uncaught OAuthException: Error validating access token. thrown in /home/techtud1/public_html/library/facebook.php on line 543 i'm a newbie to facebook development but i'm using the exact steps of this tutorial http://www.joeyrivera.com/2010/facebook-graph-api-app-easy-w-php-sdk/ when i tried to get the information of the user i got it once , but when i tried to do it again i got this error . and whatever i'm doing , i'm getting this error as a result HELP PZ

    Read the article

  • In Facebook: How to get User's list_ of_friends_ ID when User is offline[not Sign In].

    - by Vaibhav Bhalke
    Hi All In Facebook: How to get User's list_ of_friends_ ID when User is offline[not Sign In]. We are Integrating facebook application in our website.Our website development in Java's GWT[Googlw Web Toolkit] FrameWork. We are refering "Gwittit" sample codeWe open facebook account for our website and want to show all users[friends] photo conected to Website's FACEBOOK account when FB A/C is offline [not sign in]. We have used apiclient.getFriendList() in that we get list of all user id [with photo]connected to Our website's fb a/c.But Problem is that we have to sign in first and we don't want that Is there any way to solve this problem?

    Read the article

  • Post on a logged in users facebook wall

    - by Matt Nathanson
    Hey all, I've created a widget that will essentially unlock a music track, providing you post to either your twitter account, or facebook wall. I've signed up through facebook connect and I am able to successfully post onto my own wall... but the functionality I'm looking for is to be able to take ones username and password and automatically log in to facebook, and send my desired message. Like I said, it posts on my wall successfully, it's just not using the username and password from the field to log in to their respective facebooks and post. <?php $facename = $_POST['facename']; $facepass = $_POST['facepass']; define('FB_APIKEY', 'my_api_key'); define('FB_SECRET', 'my_secret_phrase_'); define('FB_SESSION', 'my_session_id'); require_once('facebook.php'); echo "post on wall"; try { $facebook = new Facebook(FB_APIKEY, FB_SECRET); $facebook->api_client->session_key = FB_SESSION; $fetch = array('friends' => array('pattern' => '.*', 'query' => "select uid2 from friend where uid1={$facename}")); echo $facebook->api_client->admin_setAppProperties(array('preload_fql' => json_encode($fetch))); $message = 'I downloaded Automatic Loveletter\'s new single \'To Die For\' here!'; if( $facebook->api_client->stream_publish($message)) echo "Added on FB Wall"; } catch(Exception $e) { echo $e . "<br />"; } ?> Any help in the right direction is greatly appreciated! Thanks, Matt

    Read the article

  • Facebook connect PHP API - friends_get() returns empty array

    - by Soufiane Hassou
    Couple of hours ago I succeed to get friends_get() to return an array of friends, but, now I don't know if it is my fault or something is wrong in facebooks' end (API problems?). Anyway I used a code from their documentation: <?php require_once 'facebook-platform/php/facebook.php'; $appapikey = ''; //CHANGE THIS $appsecret = ''; //CHANGE THIS $facebook = new Facebook($appapikey, $appsecret); //$user_id = $facebook->require_login(); $fb_user=$facebook->get_loggedin_user(); //$fb_user = $facebook->user; $friends = $facebook->api_client->friends_get(); $friends = array_slice($friends, 0, 10); $i=0; foreach ($friends as $friend) { $personArray = $facebook->api_client->users_getInfo($friend,"name"); $person[$i]=$personArray[0]; $i++; } $i=0; foreach ($person as $f) { echo " ".$f['name']; //MORE DETAILS HERE IN STEP 2 echo "<br />"; $i++; } echo "<br />"; ?> The login is working great, but, I can't retrieve the list of friends and I test also with api_client->pages_isFan and it doesn't seem to work too (says not a fan while the user is).

    Read the article

  • How to get Facebook share behavior with Facebook Connect on iPhone

    - by Benoit
    With the standard share at http://www.facebook.com/sharer.php one only needs to specify a URL. Title and thumbnail are automatically pulled from the web page (perhaps with the help of meta tags). With Facebook Connect (I am using the iPhone SDK), I need to supply everything explicitly (URL, title, caption, description, images, etc.). Is there a way to emulate the "share" behavior with Facebook Connect, i.e. let Facebook pull the missing elements from the page being shared itself?

    Read the article

  • Facebook require_login not working

    - by kielie
    hi guys, I am having some trouble with my little facebook application, I keep getting this friggin error, "Fatal error: Call to undefined method Facebook::require_login()", now the funny bit is that my exact same code is working for other people, but not for me, here is the code. <?php require_once( "facebook-php-sdk/src/facebook.php" ); $api_key = "my_api_key"; $secret = "my_secret_key"; $facebook = new Facebook( $api_key, $secret ); $user_id = $facebook->require_login(); echo "Hello World"; echo "Current logged in as <fb:name uid=\"$user_id\" />"; ?> As you can see it is a simple hello USER application, but for some reason this REFUSES to work for me, so if anyone can help out that would be great, thanx in advance!

    Read the article

  • Authorizing a Facebook Fan Page for Status Updates

    - by thechrisvoth
    I'm able to update the status on my PROFILE wall using this code: require_once 'facebook-platform/php/facebook.php'; $facebook = new Facebook('APP API KEY','APP SECRET KEY'); $user_id = 'MY USER ID'; $facebook->api_client->users_setStatus('This is a new status'); ...after authorizing using this address: http://facebook.com/authorize.php?api_key=MYAPPAPIKEY&v=1.0&ext_perm=publish_stream This code, however, does not work to update the status on my Facebook PAGE Wall. Are there additional parameters that I can add to the authorize.php url to specify authorizing the PAGE and not just my profile? Or, are there better ways to post updates to Fan Page Walls? Thanks!

    Read the article

  • PHP: Facebook stream.publish and outdated template bundles?

    - by AFK
    Ok So I haven't tried messing with the facebook PHP API for months.. it's gross. Since template bundles are apparently now defunct, how can I publish a story into my users news feed for their friends? I've also already requested permissions. Edit: The issue seems to arise from requested permissions not being set for the user when They are granted. So far I have this $appapikey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; $appsecret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; $facebook = new Facebook($appapikey, $appsecret); $fb_user = $facebook->require_login(); try { $facebook->api_client->feed_publishUserAction(); } catch(Exception $e) { } edit: I've looked through the facebook "api documentation" multiple times it's just not clear to me. I can't tell what's actually deprecated or not. They link to tutorials 2-3 years old! if you have a problem with your iframe application reloading over and over and over try using $facebook-require_frame()

    Read the article

  • Facebook Like button warning, but prevents sharing

    - by Steve
    I added a FB Like button to my Wordpress template, and when I click Like, I receive an error, which pops up and says: There was an error liking the page. If you are the page owner, please try running your page through the linter on the Facebook devsite (https://developers.facebook.com/tools/lint/) and fixing any errors. The Lint Checker (now) gives no Error or Warnings, after I removed a duplicate og:description tag. Why is it not working?

    Read the article

  • BlackBerry - Facebook extended permissions

    - by Max Gontar
    Hi! I've just found a great sample of Facebook Connect on Blackberry by Eki Y. Baskoro, The following is a short HOWTO on using Facebook Connect on Blackberry. I created a simple Facade encapsulating the Facebook REST API as well as added 'rough' MVC approach for screen navigation. I have tested on JDE 4.5 using 8320 simulator. This is still work in progress and all work is GPLed. It works great for reading stuff. NB Don't forget to get Facebook App Key and set it in TestBB class. But now I want to post something on my wall. So I've add new method to FacebookFacade class using Stream.publish API: /*** * Publishes message to the stream. * @param message - message that will appear on the facebook stream * @param targetId - The ID of the user, Page, group, or event where * you are publishing the content. */ public void streamPublish(String message, String targetId) { Hashtable arguments = new Hashtable(); arguments.put("method", "stream.publish"); arguments.put("message", message); arguments.put("target_id", targetId); try { JSONObject result = new JSONObject( int new JSONTokener(sendRequest(arguments))); int errorCode = result.getInt("error_code"); if (errorCode != 0) System.out.println("Error Code: "+errorCode); } catch (Exception e) { System.out.println(e); } } /*** * Publishes message on current user wall. * @param message - message that will appear on the facebook stream */ public void postOnTheWall(String message) { String targetId = String.valueOf(getLoggedInUserId()); streamPublish(message, targetId); } This will return Error code 200, "The user hasn't authorized the application to perform this action" First I thought it's related with Facebook - Application Settings - Additional Permissions - Publish recent activity (one line stories) to my wall but even checked, no difference... Then I've found this post explains that issue related with extended permissions. This in turn should be fixed by modifying url a little in LoginScreen class : public LoginScreen(FacebookFacade facebookFacade) { this.facebookFacade = facebookFacade; StringBuffer data = new StringBuffer(); data.append("api_key=" + facebookFacade.getApplicationKey()); data.append("&connect_display=popup"); data.append("&v=1.0"); //revomed //data.append("&next=http://www.facebook.com/connect/login_success.html"); //added data.append("&next=http://www.facebook.com/connect/prompt_permissions.php?" + "api_key="+facebookFacade.getApplicationKey()+"&display=popup&v=1.0"+ "&next=http://www.facebook.com/connect/login_success.html?"+ "xxRESULTTOKENxx&fbconnect=true" + "&ext_perm=read_stream,publish_stream,offline_access"); data.append("&cancel_url=http://www.facebook.com/connect/login_failure.html"); data.append("&fbconnect=true"); data.append("&return_session=true"); (new FetchThread("http://m.facebook.com/login.php?" + data.toString())).start(); } Unfortunately it's not working. Still Error Code 200 in return to stream.publish request... Do you have any suggestions how to resolve this? Thank you!

    Read the article

  • Cannot Logout of Facebook with Facebook C# SDK

    - by Ryan Smyth
    I think I've read just about everything out there on the topic of logging out of Facebook inside of a Desktop application. Nothing so far works. Specifically, I would like to log the user out so that they can switch identities, e.g. People sharing a computer at home could then use the software with their own Facebook accounts, but with no chance to switch accounts, it's quite messy. (Have not yet tested switching Windows users accounts as that is simply far too much to ask of the end user and should not be necessary.) Now, I should say that I have set the application to use these permissions: string[] permissions = new string[] { "user_photos", "publish_stream", "offline_access" }; So, "offline_access" is included there. I do not know if this does/should affect logging out or not. Again, my purpose for logging out is merely to switch users. (If there's a better approach, please let me know.) The purported solutions seem to be: Use the JavaScript SDK (FB.logout()) Use "m.facebook.com" instead Create your own URL (and possibly use m.facebook.com) Create your own URL and use the session variable (in ASP.NET) The first is kind of silly. Why resort to JavaScript when you're using C#? It's kind of a step backwards and has a lot of additional overhead in a desktop application. (I have not tried this as it's simply disgustingly messy to do this in a desktop application.) If anyone can confirm that this is the only working method, please do so. I'm desperately trying to avoid it. The second doesn't work. Perhaps it worked in the past, but my umpteen attempts to get it to work have all failed. The third doesn't work. I've tried umpteen dozen variations with zero success. The last option there doesn't work for a desktop application because it's not ASP.NET and you don't have a session variable to work with. The Facebook C# SDK logout also no longer works. i.e. public FacebookLoginDialog(string appId, string[] extendedPermissions, bool logout) { IDictionary<string, object> loginParameters = new Dictionary<string, object> { { "response_type", "token" }, { "display", "popup" } }; _navigateUri = FacebookOAuthClient.GetLoginUrl(appId, null, extendedPermissions, logout, loginParameters); InitializeComponent(); } I remember it working in the past, but it no longer works now. (Which truly puzzles me...) It instead now directs the user to the Facebook mobile page, where the user must manually logout. Now, I could do browser automation to automatically click the logout link for the user, however, this is prone to breaking if Facebook updates the mobile UI. It is also messy, and possibly a worse solution than trying to use the JavaScript SDK FB.logout() method (though not by much). I have searched for some kind of documentation, however, I cannot find anything in the Facebook developer documentation that illustrates how to logout an application. Has anyone solved this problem, or seen any documentation that can be ported to work with the Facebook C# SDK? I am certainly open to using a WebClient or HttpClient/Response if anyone can point to some documentation that could work with it. I simply have not been able to find any low-level documentation that shows how this approach could work. Thank you in advance for any advice, pointers, or links.

    Read the article

  • How to post HTML content in facebook wall using facebook api in php

    - by Elankeeran
    How to post HTML content in facebook wall using facebook api in php I have used below codes but not working $result = $facebook->api('/me/feed/','post',array( 'message' => '<h1>This is my demo Face book application!</h1>')); And I used as below code using php concatenate the HTML string $result = $facebook->api('/me/feed/','post',array( 'message' => 'This is my demo Facebook application!' . $htmlStr)); but not working and getting below error OAuthException: (#1) An unknown error occurred Any please help me.

    Read the article

  • Facebook graph api photo upload to a fan page album

    - by kielie
    Hi guys, I have gotten the photo upload function to work with this code, <?php include_once 'facebook-php-sdk/src/facebook.php'; include_once 'config.php';//this file contains the secret key and app id etc... $facebook = new Facebook(array( 'appId' => FACEBOOK_APP_ID, 'secret' => FACEBOOK_SECRET_KEY, 'cookie' => true, 'domain' => 'your callback url goes here' )); $session = $facebook->getSession(); if (!$session) { $url = $facebook->getLoginUrl(array( 'canvas' => 1, 'fbconnect' => 0, 'req_perms'=>'user_photos,publish_stream,offline_access'//here I am requesting the required permissions, it should work with publish_stream alone, but I added the others just to be safe )); echo 'You are not logged in, please <a href="' . $facebook->getLoginUrl() . '">Login</a> to access this application'; } else{ try { $uid = $facebook->getUser(); $me = $facebook->api('/me'); $token = $session['access_token'];//here I get the token from the $session array $album_id = 'the id of the album you wish to upload to eg: 1122'; //upload your photo $file= 'test.jpg'; $args = array( 'message' => 'Photo from application', ); $args[basename($file)] = '@' . realpath($file); $ch = curl_init(); $url = 'https://graph.facebook.com/'.$album_id.'/photos?access_token='.$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_POSTFIELDS, $args); $data = curl_exec($ch); //returns the id of the photo you just uploaded print_r(json_decode($data,true)); } catch(FacebookApiException $e){ echo "Error:" . print_r($e, true); } } ?> I hope this helps, a friend and I smashed our heads against a wall for quite some time to get this working! Anyways, here is my question, how can I upload a image to a fan page? I am struggling to get this working, when I upload the image all I get is the photo id but no photo in the album. So basically, when the user clicks the upload button on our application, I need it to upload the image they created to our fan page's album with them tagged on it. Anyone know how I can accomplish this?

    Read the article

  • Facebook Like box and Like buttons return Error

    - by spartan
    I'm integrating FB social plugins - Like box and Like buttons (as iframes) - on a web page, but they don't work. When I click on Like in "Like box", I get "Error" text with link, which displays a message dialog "The page at https://www.facebook.com/provocateur.eu could not be reached.". JSON response is: for (;;);{"__ar":1,"payload":{"requires_login":false,"success":false,"already_connected":false,"is_admin":false,"show_error":true,"error_info":{"brief":"Website Inaccessible","full":"The page at https:\/\/www.facebook.com\/provocateur.eu could not be reached.","errorUri":"\/connect\/connect_to_node_error.php?title=Website+Inaccessible&body=The+page+at+https\u00253A\u00252F\u00252Fwww.facebook.com\u00252Fprovocateur.eu+could+not+be+reached.&hash=AQARp73z7huT0Eiu"}}} When I click on the Like button, the JSON response is: for (;;);{"__ar":1,"payload":{"requires_login":false,"success":false,"already_connected":false,"is_admin":false,"show_error":true,"error_info":{"brief":"An error occurred.","full":"There was an error liking the page. If you are the page owner, please try running your page through the linter on the Facebook devsite (https:\/\/developers.facebook.com\/tools\/lint\/) and fixing any errors.","errorUri":"\/connect\/connect_to_node_error.php?title=An+error+occurred.&body=There+was+an+error+liking+the+page.+If+you+are+the+page+owner\u00252C+please+try+running+your+page+through+the+linter+on+the+Facebook+devsite+\u002528https\u00253A\u00252F\u00252Fdevelopers.facebook.com\u00252Ftools\u00252Flint\u00252F\u002529+and+fixing+any+errors.&hash=AQAFI_8ieMUGPPxS"}}} This is the "Like box" iframe code: <iframe frameborder="0" scrolling="no" style="border:none; overflow:hidden; width:240px; height:70px;" src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fprovocateur.eu&width=240&height=70&colorscheme=dark&show_faces=false&border_color&stream=false&header=true&appId=283499041689204"></iframe> and this is the "Like button" iframe code: <iframe frameborder="0" scrolling="no" style="border:none; overflow:hidden; width:203px; height:21px;" src="//www.facebook.com/plugins/like.php?href&amp;send=false&amp;layout=button_count&amp;width=203&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=21&amp;appId=283499041689204"></iframe> The behaviour is the same for admin and non-admin visitors and for any browser. I created application with the same name as FB page with appId 283499041689204. Web page is XHTML transitional valid, and it contains no errors according FB debugger/linter. Formely there was age restriction (17+), but I removed it and for the moment it is accessible for anyone (13+). URL of web page: http://provocateur.eu/ URL of FB page: in the first error message Any help appriciated. Thanks in advance.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >