2011-04-10 144 views
1

我有为了使用此代码,包括使用Facebook的API我的帖子中的照片的问题:iPhone Facebook的API附加照片张贴墙上

NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys: 
                 @"FSM",@"text",@"www.me.com",@"href", nil], nil]; 

NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks]; 


NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys: 
          @"I'm going to:", @"name", 
          @"IMG URL", @"picture", 
          self.reservation.evento.name, @"caption", 
          self.reservation.evento.date, @"description", 
          @"www.me.com", @"href", 
          nil]; 
NSString *attachmentStr = [jsonWriter stringWithObject:attachment]; 
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
           kAppId, @"api_key", 
           @"Compartir en FB", @"user_message_prompt", 
           actionLinksStr, @"action_links", 
           attachmentStr, @"attachment", 
           nil]; 

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

,一切工作正常,除了照片中并没有显示该职位。

有什么想法?

感谢

回答

1

似乎有不被根据the docs在流附件的“图片”字段。而不是“图片”字段,看来你应该有一个“媒体”字段,如

"media" : [ 
    { 
     "type": "image", 
     "src": "http://icanhascheezburger.files.wordpress.com/2009/03/funny-pictures-kitten-finished-his-milk-and-wants-a-cookie.jpg", 
     "href": "http://icanhascheezburger.com/2009/03/30/funny-pictures-awlll-gone-cookie-now/" 
    } 
]