I'm trying to pre-populate the attachment section of a facebook publish feed with the following NSStrings. My goal is to pre-populate with some dynamic data like a time interval, just like how games do with the high score or something, the FB window pops up with the highscore all ready for the user to hit submit.
Code:
[NSString stringWithFormat:@"%d weeks",[components week]];
compday.text = [NSString stringWithFormat:@"%d days",[components day]];
here's the FBconnect section where it should go. I think, Maybe i'm way off base on how to autofill in info on a FB wall post.
Code:
- (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",
@"prepopulate text here", @"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];
}
the NSString is time interval components so I'd like to populate the FB message with the time intervals, and they change daily, it's not static text like the NSDictionary has listed.
so basically how would i integrate a dynamic NSString calc into the FB connect attachment publishing code?