0

我使用以下代码从我的 iphone 应用程序发布到 FB 和 twitter

但是我怎样才能在不显示作曲家的情况下直接发布

 -(IBAction)fbposting{

   if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook ]) {


    slComplose = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
    [slComplose addImage:imageV.image];
    [slComplose addURL:[NSURL URLWithString:@"http://newagesmb.com"]];

    [slComplose setInitialText:self.textView.text];
    [self presentViewController:slComplose animated:YES completion:nil];


}

[self.textView resignFirstResponder];

}

-(IBAction)twitposting{
   if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter ]) {


    slComplose = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
    [slComplose setInitialText:self.textView.text];
    [slComplose addURL:[NSURL URLWithString:@"http://newagesmb.com"]];

    [slComplose addImage:imageV.image];

    [self presentViewController:slComplose animated:YES completion:nil];

   }
   [self.textView resignFirstResponder];


}
4

1 回答 1

0

在 SLRequest 类中使用以下方法获取 Request 对象

+(SLRequest *)requestForServiceType:(NSString *)serviceType requestMethod:(SLRequestMethod)requestMethod URL:(NSURL *)url parameters:(NSDictionary *)parameters

然后发布请求

performRequestWithHandler
于 2012-12-14T09:35:55.277 回答