Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cocoa touch iphone上的facebook发布POST API:未正确发布_Cocoa Touch_Facebook_Ios4_Facebook Graph Api - Fatal编程技术网

Cocoa touch iphone上的facebook发布POST API:未正确发布

Cocoa touch iphone上的facebook发布POST API:未正确发布,cocoa-touch,facebook,ios4,facebook-graph-api,Cocoa Touch,Facebook,Ios4,Facebook Graph Api,我正在尝试使用facebook发布API链接,如下所示 它成功发布了,但不像我预期的那样 没有标题、名称、描述、链接等 它显示为 我可以通过这个参数得到这种类型的结果 NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: @"Test test", @"message",

我正在尝试使用facebook发布API链接,如下所示

它成功发布了,但不像我预期的那样
没有标题、名称、描述、链接等
它显示为

我可以通过这个参数得到这种类型的结果

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                         @"Test test", @"message",
                                         privacyJSONStr, @"privacy",
                                         nil];
错误是什么?我们如何发布所有参数

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                         @"Test test", @"message",
                                         privacyJSONStr, @"privacy",
                                         nil];

阿米特·巴坦试试这个。。它对我有用

- (IBAction )publishStream{

    SBJSON *jsonWriter = [[SBJSON new] autorelease];

    NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys:
                                                           @"Posting From",@"text",@"http://www.google.com/",@"href", nil], nil];

    NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks];

    NSLog(@"Action Link String : %@", actionLinksStr);

    NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
                                @"Feed Name", @"name",
                                @"Feed Caption is here", @"caption",
                                @"Feed Description is here", @"description",
                                @"http://www.google.com/", @"href", nil];


    NSString *attachmentStr = [jsonWriter stringWithObject:attachment];

    NSLog(@"Attachment String : %@", attachmentStr);

    NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   @"Share on Facebook",  @"user_message_prompt",
                                   actionLinksStr, @"action_links",
                                   attachmentStr, @"attachment",
                                   nil];


    [facebook dialog:@"facebook.Stream.publish"
            andParams:params
          andDelegate:self];

}

你确定privacyJSONStr!=nil?privacyJSONStr没有空值。它在第二种情况下很好好我会试试。。。。为什么我们要给链接两次<代码>http://www.google.com 作为动作链接和附件中的href