views:

2049

answers:

1

I'm trying to post links through the iphone facebook connect without using the feed control.. I want to simulate how the publish a story works on facebooks website, where i pass a link, and it returns back an image, story title, and a link. Right now I only know how to use the feed control, but I'm thinking there has to be a way to use possibly stream.Publish or showDialog, just not really sure which..

Anyone have any experience with this?

Thanks!

+2  A: 

Use the facebook demo app.

in the SessionViewController, add this to get extended permission:

- (void)askPermission:(id)target {
  FBPermissionDialog* dialog = [[[FBPermissionDialog alloc] init] autorelease];
  dialog.delegate = self;
  dialog.permission = @"publish_stream";
  [dialog show];
}

Then you need a method to publish the stream. They don't say exactly what data to send. But whateer it is you package it in a dictionary. Since it is a URL, a good guess would be an NSString. You can get more from the API page

I found 5 that might work:

Feed.publishActionOfUser Feed.publishStoryToUser Feed.publishTemplatizedAction Feed.publishUserAction

Also there is:

Links.post

But you'll have to figure it out, depending on what you want to do. You also need to kow the key. I picked url

- (IBAction)sendURL:(id)target{

    NSMutableDictionary *args = [[[NSMutableDictionary alloc] init] autorelease];
    [args setObject:urlString forKey:@"url"];  
    FBRequest *uploadPhotoRequest = [FBRequest requestWithDelegate:self];
    [uploadPhotoRequest call:@"Links.post" params:args];
}

I've left some args out, but you get the idea. I;m not sure exactly what one you want, so you'll have to research the method calls.

Hope this helps.

Corey Floyd
This posts link without using Dialog box, How to post link using FBDialog?
Saqib Saud