2012-12-11 140 views
-1

我正在使用下面的代碼發佈在設備用戶的牆上。我也設法得到朋友名單和他們的ID。使用朋友的ID如何根據朋友的ID使用以下代碼發佈在選定的朋友的牆上?如何發佈在朋友的牆上?

if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) { 
    SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook ]; 
    SLComposeViewControllerCompletionHandler myBlock = ^(SLComposeViewControllerResult result) { 
     if (result == SLComposeViewControllerResultCancelled) { 
      NSLog(@"Cancelled"); 

     } else { 
      UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Posted!!!" 
      message:@"your status is posted to facebook successfully" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];     
      [alert show]; 
     } 

     [controller dismissViewControllerAnimated:YES completion:Nil]; 
    }; 

    controller.completionHandler =myBlock; 

    [controller setInitialText:@" hello there you got a text ..."]; 

    [self presentViewController:controller animated:YES completion:Nil]; 
} 
+0

這一點已經在這裏找到答案:http://stackoverflow.com/questions/4126400/api-facebook- iphone,可能到後期至A-朋友牆 – Anton

回答

0

發佈到其他用戶牆是截至2013年2月6日,已棄用。

https://developers.facebook.com/roadmap/completed-changes/

刪除通過圖形API張貼到牆上朋友

我們將刪除通過圖形API張貼到用戶的朋友的牆壁的能力的能力。具體而言,針對[user_id]/feed其中[user_id]不同於會話用戶的帖子,或者target_id用戶與會話用戶不同的stream.publish調用將失敗。如果您想允許用戶發佈到朋友的時間表,請調用提要對話框。通過用戶提及標籤或動作標籤的朋友的故事將顯示在朋友的時間軸上(假設朋友認可標籤)。欲瞭解更多信息,請參閱此博客文章。

相關問題