2010-11-08 6 views
1

Je voudrais simplement utiliser publish.stream pour publier sur Facebook à partir d'une application iPhone, mais sans utiliser le UIWebview qui apparaît lorsque vous appelez l'objet Facebook méthode de dialogue. Comment puis-je faire cela?Comment publier sur Facebook depuis iPhone en utilisant publish.stream sans la méthode de dialogue Facebook

+0

Je n'ai jamais rencontré de UIWebView. Utilisez-vous la nouvelle API ou l'ancienne? – jarryd

+0

Je crois que c'est le nouveau. Le code approprié est [fb dialog: @ "stream.publish" \t etParams: params etDelegate: self]; où 'fb' est un objet Facebook. –

Répondre

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

Génial. Merci Constantine. –

Questions connexes