I am posting from my iphone app to both FB and twitter using the below code
But how can i post directly without showing a composer
-(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];
}
Use following method in SLRequest class to get a Request object
+(SLRequest *)requestForServiceType:(NSString *)serviceType requestMethod:(SLRequestMethod)requestMethod URL:(NSURL *)url parameters:(NSDictionary *)parameters
then post the request
performRequestWithHandler
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.