background preloader

Facebook sdk

Facebook Twitter

How-To: Use the Graph API to Upload Photos to a user’s profile - Facebook developers. As part of our continuing series of “how tos,” we thought it’d be interesting to show how you can easily upload photos to a user’s profile.

How-To: Use the Graph API to Upload Photos to a user’s profile - Facebook developers

Photos are a deeply integrated part of the Facebook experience. Publishing photos adds a photo to user’s profile and also generates a newsfeed story about the photo with a link to your app. This is a great way to engage the user’s friends and drive interest for and traffic back to your app. Here’s a sample photo published on a user profile from my ‘Photo upload test app’ app and the newsfeed story published as a result. p> This How-To will walk you through the album and photo objects in the Graph API and the steps you need to take in order to upload a photo to a user’s profile. p> Publishing an Photo In order to publish a photo to a user’s album, you must have the publish_stream permission. . - The photo will be published to an album created for your app. Sample code will be provided for the corresponding two scenarios: Using PHP: Example Response. Upload Image to Facebook and Tag them Using PHP.

Attach image to Facebook event (php sdk, rest or graph api) PHP SDK Demystified – How PHP SDK calls the Old REST API. In the article PHP SDK Demystified – How PHP SDK calls the Graph API, we have looked at the api() method in the PHP SDK.

PHP SDK Demystified – How PHP SDK calls the Old REST API

To recap, the api() method is a pubic method that we used to call Graph API and Old REST API. The api() method is defined as: public function api(/* polymorphic */) { $args = func_get_args(); if (is_array($args[0])) { return $this->_restserver($args[0]); } else { return call_user_func_array(array($this, '_graph'), $args); } } In this article, we will take a closer look at how it calls the Old REST API.

If the first parameter (i.e. If you have take a look at the _graph function already, this piece of code should not be that difficult to understand. For Old REST API request, we have to include the application key (you should know that if you have used the Old PHP Client Library before. Wing's Blog on Facebook Development & Virtualization. In the last article, we have looked at the api() method in the PHP SDK.

Wing's Blog on Facebook Development & Virtualization

To recap, the api() method is a pubic method that we used to call Graph API and Old REST API. The api() method is defined as: public function api(/* polymorphic */) { $args = func_get_args(); if (is_array($args[0])) { return $this->_restserver($args[0]); } else { return call_user_func_array(array($this, '_graph'), $args); } } In this article, we will take a closer look at how it calls the Graph API.

If the first parameter (i.e. As we can see, _graph takes 3 parameter: $path This is the path for the Graph object that the Graph API request is working on, e.g. In many cases, while we issue “GET” graph API requests, we do not specify the $method parameter. Now, let’s recall how you call the api() method for “GET” graph API requests with parameters …. isn’t the parameters are passed as the 2nd parameter in the api() method instead of the 3rd? PHP SDK 3.0 & Graph API base Facebook Connect Tutorial. Facebook recently updated their PHP-SDK to version 3.0 also added new way of authentication.

PHP SDK 3.0 & Graph API base Facebook Connect Tutorial

This is a major change. So this is the updated post of my old popular post. In this version of my code, I avoided javascript authentication, because that is cookie based and php sdk 3.0 has some conflicts with the old system. Facebook will also update the javascript sdk soon, so later you can use the login/logout system of javascript api with php sdk. But for now you should use fully php base authentication. In this post you’ll learn: How to integrate Facebook Connect in your websiteHow to generate Facebook Login / Logout URLHow to get extended permissions from usersHow to call graph apiHow to run FQL QueryPublish Wall Post using PHPPublish Wall Post using Facebook Javascript APIInvite friends using Facebook Javascript APINo Facebook Javascript only use PHP SDK. Using Javascript FB.api to make a full post to a users wall.