I'm just playing around with the iPhone SDK and wanted to make a really simple Twitter app but I'm not sure how to do this. I just need to fetch the last 5 updates from a user just through their username. For instance, if I type in "mashable", I should get mashable's 5 latest updates. How would I do that?
Thanks so much ahead of time!
Last I checked, MGTwitterEngine was the gold-standard free library to drop in for Twitter access via Objective-C.
http://mattgemmell.com/2008/02/22/mgtwitterengine-twitter-from-cocoa
Did you support twitter login yet? If yes, you just need to call the Rest API using some NSUrlConnection
Related
I would love to know where to start to understand how to integrate Twitter in my iPhone applications.
So here are a few questions:
Is it madness trying to implement anything without an Oauth library?
Which of these methods should I use to obtain an access token (I want to open safari.app and get redirected back to my application using iOS url schemes, à la Twitterific)?
Can I avoid browser based authentication with iOS 5 Twitter integration?
Hope you can help.
If you're okay with requiring iOS 5, than Twitter.framework is the best/easiest way to go. They handle OAuth and everything for you. Everything is done simply by using TWRequest. It's very simple.
If you need to support older versions of iOS, than you should take a look at MGTwitterEngine. I believe that there are some forks of it on github that incorporate OAuth.
But with that being said, I highly recommend that you just target iOS 5 and forget iOS 4. It will make implementing Twitter much easier. If you need convincing, check out Matt Gemmell's blog post about why it's okay to only support the latest operating system: http://mattgemmell.com/2011/12/05/latest-version/
EDIT: And yes, Twitter.framework handles authentication for you. No need to use the browser. But users will need to add their Twitter accounts in the Settings app beforehand. If you want them to be able to add accounts through your app, then I believe you need to handle authentication yourself.
For quite a while now, I've been trying to find a good way to simply post updates/photos to a user's twitter account via my iOS app. I've looked at ShareKit, but I really need to be able to design my own UI. Also, I've taken a look at MGTwitterEngine, but am unsure as how to implement it. Is there a "right" way to go about posting updates to Twitter with a custom UI on iOS?
Any help would be greatly appreciated. Thanks.
Given Apple's TWTweetRequest object, calls made to the Twitter service can now be orchestrated right through iOS without the need for an external framework or engine. Just look at the Twitter developer docs and make the calls you need, specifying the correct information in a dictionary for the process to complete successfully.
I've been researching the latest ways to integrate Twitter into my app and it appears the best (most painless) approach is to use the MGTwitterEngine, and the best tutorial I could find to implement this is a 3-part series. If all I need to do is allow the user to login to their twitter account and post a single tweet that's always the same, is there an easier way to do that than following the tutorial I linked to?
Thanks so much for your wisdom. If the alternatives aren't much easier, no problem, I'm not so lazy that I can't follow a tutorial, I was just wondering if there's a quicker way that I didn't see.
Create a button that opens a UIWebView when clicked. Build the URL using details here: http://twitter.com/about/resources/tweetbutton. Simple - about 10 lines of code.
I'm a big fan of st3fan's (Stefan Arentz) https://github.com/st3fan/iphone-twitter project. It's very easy to integrate and includes whole views that you can just use, easily customizable too.
Plan your Twitter implementation ahead - with an iPhone project you will want to use xAuth authentication which does not require a round trip to the web browser.* You have to first register your app and then request permission for your application to use this method. Check the Twitter developer pages for more details.
*or not. But I hate leaving the app to post tweets.
I have recently wired up my application to use the Facebook iOS SDK (http://github.com/facebook/facebook-ios-sdk). The integration works fine, but the pages loads really slow. It takes really a long time to load the login screen. Login action takes more than 10-60 seconds.
I didn't have this problem with Facebook Connect. Am I missing something? Is there a way to optimize this?
Update
I did scan the activity through HTTP Scoop over Wi-Fi which revealed something interesting, there are some .js and .css files that are taking a lot of time in the new Facebook iOS SDK (login.php, ar7ed2ft.css, 4wj242ne.js, abl6sgyy.js,) where as the old one was zippy. How to let Facebook know about it?
New Facebook iOS SDK
Old Facebook Connect
Implement OAuth 2.0 yourself. It just uses HTTPS, extremely easy to implement. In my experience, it was easier than using their confusing, document-less SDK. Important is getting authentication token. You can access all their graphs with it.
If you implement it yourself, you can choose login screen dialog design as one of:
touch
WAP
WAP is uglier because it's for older phones, but if you really need it, it may help you.
Try using this one http://github.com/facebook/facebook-iphone-sdk
Is there any wrapper available for Twitter in X-Code? if not then do I have to call original Twitter API in my Iphone's application?
Why not give http://mattgemmell.com/2008/02/22/mgtwitterengine-twitter-from-cocoa a go, it works with the iPhone and has been recommended by quite a few people.
You can try MGTwitterEngine.
I am just starting to look at it myself.