如何从IOS应用程序在好友墙上发布Facebook提要?

如何从IOS应用程序在好友墙上发布Facebook提要?,ios,facebook,facebook-graph-api,Ios,Facebook,Facebook Graph Api,如何从IOS应用程序在好友墙上发布Facebook订阅源? 社交框架对于分享和发布非常有用 Fb,Twitter 在对话框中,它将要求隐私,我们可以将其设置为friends/Piblic/Me if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) { // Initialize Compose View Controller SLComposeViewControlle

如何从IOS应用程序在好友墙上发布Facebook订阅源?

  • 社交框架对于分享和发布非常有用 Fb,Twitter
  • 在对话框中,它将要求隐私,我们可以将其设置为friends/Piblic/Me

        if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
        // Initialize Compose View Controller
        SLComposeViewController *vc = nil;
        vc = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
        // Configure Compose View Controller
        [vc setInitialText:self.captionTextField.text];
        [vc addImage:self.image];
        [vc setCompletionHandler:^(SLComposeViewControllerResult result){
            if (result == SLComposeViewControllerResultDone) {
                [[[UIAlertView alloc] initWithTitle:@"Congratulations" message:@"Your post is successfully Posted" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil] show];
    
            }else{
            }
        }];
        // Present Compose View Controller
        [self presentViewController:vc animated:YES completion:nil];
    } else {
        NSString *message = @"It seems that we cannot talk to Facebook at the moment or you have not yet added your Facebook account to this device. Go to the Settings application to add your Facebook account to this device.";
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Oops" message:message delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
        [alertView show];
    }
    

通过Graph API,您无法将其张贴到朋友的墙上,它已被弃用

您可以使用调用该对话框,用户可以将提要发布给任何朋友,代码如下:

NSMutableDictionary *params =
    [NSMutableDictionary dictionaryWithObjectsAndKeys:
        @"An example parameter", @"description",
        @"https://developers.facebook.com/ios", @"link",
        nil];

[FBWebDialogs presentFeedDialogModallyWithSession:nil
    parameters:params
    handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {}
];
查看更多详细信息和可用参数列表。

官方网站是一个很好的起点。当你需要为你所面临的问题提供一个具体的问题时,你不应该仅仅要求实现一个规范。