Reputation: 3402
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?
Upvotes: 1
Views: 647
Reputation: 381
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];
Upvotes: 0
Reputation: 1356
Photo sharing uplaod feature is now available on Twitter, but there's no stable library for iphone yet released.
Upvotes: 0
Reputation: 58097
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.
Upvotes: 1