1
我想將圖片和文字張貼到朋友的牆上。我不應該使用對話框,我正在使用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];
現在我面臨的另一個問題。你能告訴我如何張貼飼料給多個朋友嗎?因爲我正在使用facebookref變量的單個實例。 – Rahul
發出多個請求。我沒有看到任何方式發佈到文檔中的多個提要。 –