如何将NEW LINE放入Facebook Wall发布消息?

时间:2012-06-27 07:03:41

标签: iphone

如何在Facebook post wall留言中添加新行(“Caption”)...... \ n不接受任何其他方式......

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               StrImg, @"picture",
                               StrName, @"name",
                               strURL, @"link",
                               emailBody, @"caption",
                               actionLinksStr, @"actions",
                               nil];


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

1 个答案:

答案 0 :(得分:0)

请尝试使用以下代码可能会解决您的问题。

    - (IBAction)Publish {
        // Show the activity indicator.
        [self showActivityView];

        // Create the parameters dictionary that will keep the data that will be posted.
        NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                       @"My test app", @"name",
                                       @"http://www.google.com", @"link",
                                       @"FBTestApp app for iPhone!", @"caption",
                                       @"This is a description of my app", @"description",
                                       @"Hello!\n\nThis is a test message\nfrom my test iPhone app!", @"message",              
                                       nil];

        // Publish.
        // This is the most important method that you call. It does the actual job, the message posting.
        [facebook requestWithGraphPath:@"me/feed" andParams:params andHttpMethod:@"POST" andDelegate:self];

**Edit**

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