stream.publish permission denied

Sep 17, 2009 at 2:46 AM

I am developing a web application that will run outside of facebook and will publish messages to users.  I have a similar situation to this post http://facebooktoolkit.codeplex.com/Thread/View.aspx?ThreadId=58923 however when I use stream.publish I get permission denied error. Will people have to explicitly add my application to their facebook profile and give it publish permissions?  Here is my test code so far:

facebook.Components.FacebookService _fbService = new facebook.Components.FacebookService();

string KEY = ConfigurationManager.AppSettings["APIKey"].ToString();
string SECRET = ConfigurationManager.AppSettings["Secret"].ToString();
_fbService.ApplicationKey = KEY;
_fbService.Secret = SECRET;

var friends = _fbService.friends.getUserObjects();
foreach (facebook.Schema.user friend in friends)
{
  ListItem li = new ListItem(friend.name, friend.uid.ToString());

  attachment attachment = new attachment();

  attachment.caption = "www.bigtimedesign.ca";
  attachment.name = "Radar Facebook test";
  attachment.href = "http://www.bigtimedesign.ca";
  attachment.description = "Radar's first facebook push";
  attachment.properties = new attachment_property()
  {
   category = new attachment_category()
        {
         href = "http://www.bigtimedesign.ca/category/Radar",
                text = "Radar"
        },
        ratings = "5 stars"
  };
            
  attachment.media = new List<attachment_media>(){new attachment_media_image()
  {
   src = "http://icanhascheezburger.files.wordpress.com/2009/03/funny-pictures-your-cat-is-bursting-with-joy1.jpg",
        href = "http://icanhascheezburger.com/2009/04/22/funny-pictures-bursting-with-joy/"
  }};

  _fbService.API.stream.publish("This is a test message from Radar", attachment, null, friend.uid.ToString(), Convert.ToInt32(friend.uid));

Coordinator
Sep 18, 2009 at 10:20 PM

you need to send them to page to request permissions.

 

I am thinking I am going to try to add this functionality into the base Session objects that are being put together in version 3.0 (this weekend).  But, in the meantime, you should look at this page on suggestions of your options for requesting the appropriate permissions.

 

http://wiki.developers.facebook.com/index.php/Extended_permissions

Oct 9, 2009 at 12:14 AM

This is long overdue but thank you for your post it sent me in the right direction and now I'm well on my way.