2011-09-09 5 views
1

내가 작업하고있는 iPhone 앱에 Facebook 북 게시물을 구현하려고합니다.Facebook iPhone SDK - 자동으로 PublishSteam (벽에 게시 대화 상자 무시)

"벽에 게시"대화 상자를 무시하고 바로 제출할 수있는 방법은 무엇입니까?
기본적으로 나는 URL을 게시하려하고 있으며 사람들이 "Write something"텍스트 상자를 볼 수있게하고 싶지 않습니다.

여기에 샘플 앱의 코드가 있습니다.

SBJSON *jsonWriter = [[SBJSON new] autorelease]; 

NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys: 
          @"Always Running",@"text",@"http://itsti.me/",@"href", nil], nil]; 

NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks]; 
NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys: 
          @"a long run", @"name", 
          @"The Facebook Running app", @"caption", 
          @"it is fun", @"description", 
          @"http://itsti.me/", @"href", nil]; 
NSString *attachmentStr = [jsonWriter stringWithObject:attachment]; 
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
          @"Share on Facebook", @"user_message_prompt", 
          actionLinksStr, @"action_links", 
          attachmentStr, @"attachment", 
          nil]; 


[_facebook dialog:@"feed" 
     andParams:params 
    andDelegate:self]; 


가 티

답변

3

그냥 페이스 북 클래스의 - (FBRequest*)requestWith... 인스턴스 방법 중 하나를 사용 해주셔서 감사합니다.

이전 REST API를 사용하여 간단한 벽 게시물 :

NSString *facebookStatusMessage = @"facebookStatusMessage"; 
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
           facebookStatusMessage, @"status", 
           nil]; 

FBRequest *request = [_facebook requestWithMethodName:@"status.set" andParams:params andHttpMethod:@"POST" andDelegate:self]; 

그것은 REST API는 사용되지 얻을 것이다으로 - (FBRequest*)requestWithGraphPath:와 페이스 북 그래프 API를 사용하는 것이 좋습니다.

그리고 또한 FBRequestDelegate 프로토콜의 일부 구현 :

- (void)request:(FBRequest *)request didFailWithError:(NSError *)error { 
} 

- (void)request:(FBRequest *)request didLoad:(id)result { 
    // result may be a dictionary, an array, a string, or a number, 
    // depending on the format of the API response 
} 
관련 문제