2013-04-30 57 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/

相關問題