2010-11-08 61 views
1

我只想使用publish.stream從iPhone應用程序發佈到Facebook,但不使用調用Facebook對象時彈出的UIWebview對話方法。我該怎麼做呢?如何使用publish.stream不使用Facebook對話框方法從iPhone發佈到Facebook

+0

我從來沒有遇到過UIWebView。 你使用新的api還是舊的? – jarryd 2010-11-09 01:34:56

+0

我相信它是新的。相關的代碼是[fb dialog:@「stream.publish」 \t andParams:params andDelegate:self];其中'fb'是Facebook對象。 – 2010-11-09 02:03:30

回答

2
SBJSON *jsonWriter = [[SBJSON alloc] init];  NSDictionary *attchmentDic = [NSDictionary dictionaryWithObjectsAndKeys: 
           @"Foobar",@"name", 
           nil];  NSString *attachmentStr = [jsonWriter stringWithObject:attchmentDic]; NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
           @"Bla-bla",@"message", 
           attachmentStr, @"attachment", 
           nil]; 
     [_facebook requestWithMethodName:@"stream.publish" 

         andParams:params 
        andHttpMethod:@"POST" 
        andDelegate:self];  [jsonWriter release]; 
+0

太好了。感謝君士坦丁。 – 2010-11-09 16:51:44

相關問題