How to get extended permissions for Flash Facebook API!

how to get facebook profile picture

This tutorial is going to teach you how to get the logged in user’s profile picture and post to their wall.

Thanks to Adobe’s Flex Examples, much of the code is used from their samples. I would also like to thank permadi.com for their tutorial on using the Facebook Graph API. I used their tutorial as a starting point, and used Adobe’s examples as references to take it to the next level.

For this tutorial, I only used the least amount of coded needed to do the 3 objections.

Here is the Facebook API that I’ve used:
http://code.google.com/p/facebook-actionscript-api/downloads/detail?name=GraphAPI%20Source_1_0.zip&can=2&q=label%3AFeatured

Facebook Samples from Adobe:
http://www.adobe.com/devnet/facebook/samples.html#6

Graphi API Reference:
http://developers.facebook.com/docs/reference/api/user

You will need to make these files to make it work. www.griffinsdesigns.com/FacebookSample.zip

Flash Facebook App, Post to wall

Click image to view the app!

extended permissions for flash facebook api

Here is a snippet of the code:

import com.facebook.graph.Facebook;
import com.facebook.graph.data.FacebookSession;
import com.facebook.graph.net.FacebookRequest;

Extended Permissions
In the index.php file, in the Javscript redirect() function, go the the top.location line of code. After &scope=, insert the extended permission that you want.

For example:
publish_stream, create_event, rsvp_event, sms, offline_access, manage_pages, email, read_insights, read_stream, read_mailbox, ads_management, xmpp_login, user_about_me, user_activities, user_birthday, user_education_history, user_events, user_groups, user_hometown, user_interests, user_likes, user_location, user_notes, user_online_presence, user_photo_video_tags, user_photos, user_relationships, user_religion_politics, user_status, user_videos, user_website, user_work_history, email,publish_stream,offline_access,read_stream

In your Flash app, instead of using Facebook.login(callbackhandler);
use:
ExternalInterface.call(“redirect”,”THE APPLICATION ID”, “user_birthday,read_stream,publish_stream”,”http://apps.facebook.com/THE CANVAS PAGE/”);

Here is the site that I found out about the ExternalInterface call.
http://www.adobe.com/newsletters/edge/november2010/articles/article6/index.html?trackingid=IBEPU

To get the user’s info
Facebook.api(‘/me/’, userInfo);

function userInfo(response:Object, fail:Object){
nameTextField.text = response.id;
}

To get the user’s profile picture, you need to do a load from a url similar to this:
https://graph.facebook.com/”+id+”/picture”.

Once the image is loaded, add it to the stage.

To post to the user’s wall, you need to use this function:
Facebook.api(‘/me/feed’, onMyInfoLoaded, values, ‘POST’);

Values is the message that you want to post.

I’m not affiliated with Facebook or Adobe.