2012-08-01 30 views
1

我正在尝试使用FBConnect sdk发布到Facebook。
当我提供图片的链接时,一切正常。
enter image description here

但是,当图片丢失时,没有其他信息显示。
enter image description here
我做错了什么或这是FBConnect中的错误。
的代码是:图片丢失时FB Feed对话框中没有信息


    NSMutableDictionary *params = [NSMutableDictionary dictionary]; 
     [params setValue:name forKey:@"name"]; 
     [params setValue:address forKey:@"caption"]; 
     [params setValue:descrption forKey:@"description"]; 
     [params setValue:website forKey:@"link"]; 
     if(thumbnail.serverPath) 
      [params setValue:thumbnail.serverPath forKey:@"picture"]; 

     [facebook dialog:@"feed" andParams:params andDelegate:self]; 

回答

1

与在饲料对话框缺少的信息想通的问题。
原来,为了正确显示的信息,无论是链接图片必须在PARAMS字典进行设置。
不知道,为什么是这样。但无论如何,解决问题的新代码是:


     NSMutableDictionary *params = [NSMutableDictionary dictionary]; 
     [params setValue:name forKey:@"name"]; 
     [params setValue:address forKey:@"caption"]; 
     [params setValue:descrption forKey:@"description"]; 
     [params setValue:website forKey:@"link"]; 
     if(thumbnail.serverPath) 
      [params setValue:thumbnail.serverPath forKey:@"picture"]; 

     //IMPORTANT 
     //Before posting check that there is a valid link for the picture. 
     //If not, then add 
     //to ensure that rest of the info is displayed correctly in the feed. 
     if(![params valueForKey:@"picture"]) { 
      [params setValue:@"http://www.abc.com/images/xyz.png" forKey:@"picture"]; 
     } 

     [facebook dialog:@"feed" andParams:params andDelegate:self];