views:

18

answers:

1

I can use the Facebook iPhone API to authorize and publish posts, but I want the textbox on the dialogue view bigger, to display more text, instead of only showing 2 lines, as the screenshot:


alt text

Anybody know how to make this textbox bigger? Does it have to change the Facebook API code?

If the textbox is supposed to be short as the title of the wall post, how to send the App icon and more text underneath the textbox as shown in the screenshot? (I only know how to publish the text in the textbox for the moment)

A: 

Regarding the text under your image, you can check the demo provided with the iOS library. For examle, the part that uploads that text can be found at this file:

- (IBAction) publishStream: (id)sender {

  SBJSON *jsonWriter = [[SBJSON new] autorelease];

  NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys:
                               @"Always Running",@"text",@"http://itsti.me/",@"href", nil], nil];

  NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks];
  NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
                               @"a long run", @"name",
                               @"The Facebook Running app", @"caption",
                               @"it is fun", @"description",
                               @"http://itsti.me/", @"href", nil];
  NSString *attachmentStr = [jsonWriter stringWithObject:attachment];
  NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                 kAppId, @"api_key",
                                 @"Share on Facebook", @"user_message_prompt",
                                 actionLinksStr, @"action_links",
                                 attachmentStr, @"attachment",
                                 nil];


  [_facebook dialog: @"stream.publish"
          andParams: params
        andDelegate:self];

}

If you want to add an image at this post as well, try

NSDictionary* media = [NSDictionary dictionaryWithObjectsAndKeys:
                           @"image", @"type",
                           @"your.image/url.png", @"src",
                           @"http://www.alink.org", @"href",
                           nil];

and then you should add this to your attachment NSDictionary:

NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
                                   @"a long run", @"name",
                                   @"The Facebook Running app", @"caption",
                                   @"it is fun", @"description",
                                   [NSArray arrayWithObjects:media, nil ], @"media",
                                   @"http://itsti.me/", @"href", nil];

You can check some guidelines for stream attachements at this link. I hope that helps!

Irene