Я пытаюсь опубликовать изображение и текст на стене друга. Я не должен использовать диалоговое окно, я использую stream.publish для прямой публикации.
Я могу успешно опубликовать его на своей стене (вошедший в систему пользователь), но мне нужно найти способ разместить на стене друга.
Вот мой код. Мне нужно, чтобы кто-нибудь помог мне добавить несколько строк кода для публикации на стене друга.
/*
Friends URL To whom's wall I need to post.
**I need to figure out how to use friendURL in my code.
So that post goes to my friend's wall.
Below code is posting to my own wall.**
*/
NSString *friendURL = [NSString stringWithFormat:
@"http://www.facebook.com/profile.php?id=%@",
marriedFriend.userID];
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 by Rahul...", @"name",
@"The Facebook Running app", @"caption",
@"it is fun", @"description",
@"http://itsti.me/", @"href", nil];
NSString *attachmentStr = [jsonWriter stringWithObject:attachment];
NSMutableDictionary* params = [NSMutableDictionary
dictionaryWithObjectsAndKeys:
@"Share on Facebook", @"user_message_prompt",
actionLinksStr, @"action_links",
attachmentStr, @"attachment",
nil];
[facebookRef requestWithMethodName:@"stream.publish" andParams:params andHttpMethod:@"POST" andDelegate:self];