This week, we updated the JavaScript SDK to support OAuth 2.0 and extended the timeline for apps to migrate to OAuth 2.0 by October 1st.
Similiar to other social plugins, the Facepile plugin is now also available in the dark color scheme.
You can preview Facepile in the dark background by toggling the 'color scheme' field to 'dark' in the Facepile configurator.
<br/>
<br/>
Earlier this year, we released support for uploading photos directly via the Graph API. This requires sending the photo as a MIME-encoded form field. We are now enhancing our photo upload capability by introducing the ability to upload photos simply by providing a URL to the image. This simplifies photo management for a number of use cases:
To upload a photo via a URL, simply issue an HTTP POST to ALBUM_ID/photos with the url field set to the URL of the photo you wish to upload. You need the publish_streampermission to perform this operation. You can also include an optional message parameter to set a caption for the photo. For example:
<?php
$app_id = "APP_ID";
$app_secret = "APP_SECRET";
$post_login_url = "POST_AUTH_REDIRECT_URL";
$album_id = "ALBUM_ID";
$photo_url = "PHOTO_URL";
$photo_caption = "PHOTO_CAPTION";
$code = $_REQUEST["code"];
//Obtain the access_token with publish_stream permission
if (!$code){
$dialog_url= "http://www.facebook.com/dialog/oauth?"
. "client_id=" . $app_id
. "&redirect_uri=" . urlencode( $post_login_url)
. "&scope=publish_stream";
echo("<script>top.location.href='" . $dialog_url
. "'</script>");
} else {
$token_url="https://graph.facebook.com/oauth/access_token?"
. "client_id=" . $app_id
. "&client_secret=" . $app_secret
. "&redirect_uri=" . urlencode( $post_login_url)
. "&code=" . $code;
$response = file_get_contents($token_url);
$params = null;
parse_str($response, $params);
$access_token = $params['access_token'];
// POST to Graph API endpoint to upload photos
$graph_url= "https://graph.facebook.com/"
. $album_id . "/photos?"
. "url=" . urlencode($photo_url)
. "&message=" . urlencode($photo_caption)
. "&method=POST"
. "&access_token=" .$access_token;
echo '<html><body>';
echo file_get_contents($graph_url);
echo '</body></html>';
}
?>
The HTTP POST may take some time to complete, depending on picture size, network availability, etc.
This week we released the ability to attach existing Facebook photos from a user’s album to new posts on their Wall. To do this, issue an HTTP POST to USER_ID/feed with the Post object parameters. Include an object_attachment parameter which specifies the photo ID of the photo you wish to attach to the post. The User must be the owner of the photo, and the photo cannot be part of a message attachment.
For example:
<?php
$app_id = "APP_ID";
$app_secret = "APP_SECRET";
$post_login_url = "POST_AUTH_REDIRECT_URL";
$photo_id = "PHOTO_ID";
$wall_message = "MESSAGE_FOR_POST";
$wall_link = "LINK_TO_POST";
$user_id = "USER_ID";
$code = $_REQUEST["code"];
// Obtain the access_token with publish_stream permission
if (!$code) {
$dialog_url= "http://www.facebook.com/dialog/oauth?"
. "client_id=" . $app_id
. "&redirect_uri=" . urlencode( $post_login_url)
. "&scope=publish_stream";
echo("<script>top.location.href='" . $dialog_url
. "'</script>");
} else {
$token_url="https://graph.facebook.com/oauth/access_token?"
. "client_id=" . $app_id
. "&redirect_uri=" . urlencode( $post_login_url)
. "&client_secret=" . $app_secret
. "&code=" . $code;
$response = file_get_contents($token_url);
$params = null;
parse_str($response, $params);
$access_token = $params['access_token'];
// POST to Graph API feed endpoint, which is the user's Wall
$graph_url= "https://graph.facebook.com/" . $user_id . "/feed?"
. "message=" . urlencode($wall_message)
. "&link=" . urlencode($wall_link)
. "&object_attachment=" . $photo_id
. "&method=POST"
. "&access_token=" .$access_token;
echo '<html><body>';
echo file_get_contents($graph_url);
echo '</body></html>';
}
?>
See the /posts connection on the Graph API User object for further details.
We have updated the FQL documentation for the following tables:
103 docs are under review
Bugzilla activity for the past 7 days:
Developer Forum activity for the past 7 days:
TAGS
Sign up for monthly updates from Meta for Developers.