2012-06-27 72 views
3

如何把Facebook的柱壁消息(「標題」)的新線... \ n不接受任何其他方式...如何將NEW LINE放入Facebook Wall發佈消息?

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


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

嘗試此鏈接。它會幫助你。 http://stackoverflow.com/questions/6376644/facebook-graph-api-how-to-post-to-wall-with-new-lines –

回答

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]; 
} 
+0

感謝您的即時回覆......但此方法只顯示對話框[[delegate facebook]對話框:@「feed」andParams:paramsandDelegate:self]; –

+0

感謝您的即時回覆......但是此方法僅顯示對話框[[委託臉譜]對話框:@「feed」andParams:paramsandDelegate:self]; –

+0

+1,如果你滿意我的答案。 –