Is there any way to upload photo on Twitter using xAuth or OAuth authentication in iPhone? Is there any开发者_开发知识库 sample code or framework I can use?
According to this answer it's not possible to upload images directly to Twitter. You need to yup load to some other photo-sharing site, and link to it in your Twitter post. I'd recommend looking into imgur. They have an API which you may be able to use.
Photo sharing uplaod feature is now available on Twitter, but there's no stable library for iphone yet released.
It's very easy in iOS 5.
Just include the header file #import "Twitter/Twitter.h"
and add the framework Twitter.framework in the project..
Then add the lines below for a button action:
TWTweetComposeViewController *tweeter = [[TWTweetComposeViewController alloc] init];
[tweeter setInitialText:@"message"]; // for posting text
[tweeter addImage:image]; // for posting image
[self presentModalViewController:tweeter animated:YES];
精彩评论