1

我正在尝试使用FBConnect sdk 发布到 Facebook。
当我提供图片的链接时,一切正常。
在此处输入图像描述

但是当图片丢失时,不会显示其他信息。
在此处输入图像描述
我做错了什么还是这是 FBConnect 中的错误。
代码是:


    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];
4

1 回答 1

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];
于 2012-08-02T09:41:14.467 回答