如何使用iOS通过Facebook在朋友墙上发布UIImage

时间:2013-12-20 21:44:44

标签: ios iphone facebook facebook-php-sdk fbconnect

我正在使用社交框架附加文本和图像以在Facebook和Twitter上分享,但共享是在我的墙上完成的。我需要添加选项以在朋友的墙上发布。 我的代码如下

“AttachmentTableViewController.h”

#import <UIKit/UIKit.h>

@interface SocialSharingViewController : UIViewController
- (IBAction)postToTwitter:(id)sender;
- (IBAction)postToFacebook:(id)sender;

@end

“AttachmentTableViewController.m”
#import <Social/Social.h>

- (IBAction)postToTwitter:(id)sender {
    if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
    {
        SLComposeViewController *tweetSheet = [SLComposeViewController
                                               composeViewControllerForServiceType:SLServiceTypeTwitter];
        [tweetSheet setInitialText:@"Great fun to learn iOS programming at appcoda.com!"];
        [self presentViewController:tweetSheet animated:YES completion:nil];
    }
}
- (IBAction)postToFacebook:(id)sender {
    if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
        SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];

        [controller setInitialText:@"First post from my iPhone app"];
        [self presentViewController:controller animated:YES completion:Nil];        
    }
}

此代码发布在我的墙上,但我需要添加在朋友的墙上分享的可能性。请帮忙。

非常感谢!

0 个答案:

没有答案