在我的墙上发布消息facebook ios sdk?

时间:2013-04-30 11:34:01

标签: iphone facebook-ios-sdk

大家好我想在我的墙上贴一条消息,但同时瞄准朋友。就像我们在墙上发布的@friendsname。我正在使用下面的代码

 NSMutableDictionary* params1 = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                    @"post", @"type",
                                    urlQRCode, @"picture",
                                    [globals linktoapp], @"link",
                                    @"xsxsx", @"name",
                                    @"sxsxsxsxsx", @"caption",
                                    @"sxsxssx", @"description",
                                    messsdsage, @"message",
                                    @"friendfbuid", @"to",
                                    nil];



    [appDelegate.facebook requestWithGraphPath:@"me/feed"
                                     andParams:params1
                                 andHttpMethod:@"POST"
                                   andDelegate:self];

2 个答案:

答案 0 :(得分:1)

+(SHKItem *)image:(UIImage *)image title:(NSString *)title;


UIImage *image = [UIImage imageNamed:@"sanFran.jpg"];
SHKItem *item = [SHKItem image:image title:@"Look at this picture!"];

阅读文档和下载共享工具包单击Hare .. http://getsharekit.com/docs/

答案 1 :(得分:0)

- (void) postImageToFacebook {

appDelegate = (ScorecardAppDelegate *)[[UIApplication sharedApplication] delegate];

currentAPICall = kAPIGraphUserPhotosPost;

UIImage *imgSource = {insert your image here};
NSString *strMessage = @"This is the photo caption";
NSMutableDictionary* photosParams = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                     imgSource,@"source",
                                     strMessage,@"message",
                                     nil];

[appDelegate.facebook requestWithGraphPath:@"me/photos"
                                 andParams:photosParams
                             andHttpMethod:@"POST"
                               andDelegate:self];     

// after image is posted, get URL for image and then start feed dialog
// this is done from FBRequestDelegate method
}

试试这个。它可能对你有帮助。