我剛剛下載了Facebook SDK for iOS,因爲我需要能夠發佈自定義流到用戶的Facebook供稿。示例應用程序有一個名爲publishStream:(id)sender的方法,似乎爲Publish Stream對話框設置了一個自定義描述,但是當我的對話框出現時,我看到的是一個空的對話框以開始輸入。示例中的代碼應用是這樣的:Facebook連接iPhone自定義發佈流
`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:
@"Share on Facebook", @"user_message_prompt",
actionLinksStr, @"action_links",
attachmentStr, @"attachment",
nil];
[_app.facebook dialog:@"feed"
andParams:params
andDelegate:self];`
該代碼是否應該填充自定義流?如果是這樣,爲什麼不是演示項目爲我做的?如果不是,我需要採取哪些步驟才能使用自定義數據填充流?
感謝您的幫助,
謝謝,這就像一個魅力 – SSS 2011-03-01 17:56:09
你節省了我的時間非常感謝。 – yogs 2011-04-15 08:49:24
你好,我正在使用這個,但我面臨另一個問題,該帖子只發布在用戶的牆上,但不是在他的家庭飼料。所以該用戶的其他朋友不知道這一點。你面對這個問題還是有任何解決方法? – 2011-05-18 09:00:19