2013-04-30 62 views
0

大家好,我正在尝试在我的墙上张贴消息,但是却瞄准了一位朋友。就像我们张贴在我们墙壁@friendsname。我现在用下面发布消息在我的墙上facebook ios sdk?

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

您不能发布到朋友的墙[再](https://developers.facebook.com/blog/post/2012/10/ 10/grow-quality-apps-with-open-graph /),因为它已经被弃用,因为它产生了很多负面反馈。要标记用户在自己墙上的帖子中,您需要提供一个地址标识,如[此处]所述(https://developers.facebook.com/docs/reference/api/user/#posts)。或者(更好的方式)考虑实施[行动/故事](https://developers.facebook.com/docs/opengraph/using-actions/)。 – andreagiavatto 2013-04-30 11:59:57

+0

你好,谢谢..我想用这个,但是没有提到任何朋友。 Nsstring * message = @“message message @ [fbuid:1:XXXX]”; – veereev 2013-04-30 12:17:57

+0

提及的朋友也不可能通过旧版Graph API作为墙贴。如果你使用一个动作(也许使用'显式共享',所以它现在被转换成用户时间轴上的故事,而不是一个简单的动作),你可以标记或提到朋友,就像[这里]解释的那样(https://开发者.facebook.com /文档/ opengraph /引导/标签/#提到)。 – andreagiavatto 2013-04-30 12:25:00

回答

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 
} 

代码试试这个。它可能会帮助你。

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


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

读取DOC和下载共享套件点击野兔.. http://getsharekit.com/docs/

相关问题