开发者

iPhone:How to upload photos on twitter using xAuth or OAuth authentication?

开发者 https://www.devze.com 2023-03-27 02:59 出处:网络
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

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];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号