Starting point for Oauth and Twitter API (for iOS development) - iphone

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.

Related

How to integrate Like feature in iPhone SDK 3.1 with Facebook sharing app

I am new to iPhone development. I’ve added Facebook sharing functionality and I also want to add the Like feature from Facebook. I’ve followed one of the examples; it works if Facebook sharing functionality hasn’t been implemented, because some files create contradiction (specifically FBRequest.h). But I want to add both sets of functionality at the same time. Any suggestions?
If you are new then its not a issue. Everybody have same brain. So its not a big issue. Check
this link: http://www.raywenderlich.com/1626/how-to-post-to-a-users-wall-upload-photos-and-add-a-like-button-from-your-iphone-app
First of all understand it then implement it. I know you will surely implement this in Your
App. Best of luck.

is there any single library for twitter sharing in ios4 and ios 5

I need to share one video url getting from my server in twitter.
And my app must be compatible for both ios 4.0 and ios 5.0.
I know that there is twitter+oauth library for ios 4.0 and twitter inbuilt library for ios 5.0. And my functionality is twitter library need to ask user credentials only once for twitter authentication and need to post that video url in background with out asking user permission.
From the second time onwards video must posted in background.
As per my knowledge we have different libraries we need to use but is there any solution that do implemant my task with one library.
Please help me.
For a beautiful implementation, check out DETweetComposeViewController.
It will provide you with a UI that looks almost identical to what iOS5 users now are growing accustomed to. The great point is, it works on iOS4 and iOS5 flawlessly.
GetShareKit was a basic library created by Nate Weiner that's now outdated. If you check it's GitHub source, the last commit was sometime in 2010. This version is buggy and has about 20+ compile warnings. this uses an older version of the Facebook and Twitter sharing mechanisms that are now deprecated and also, buggy. Clicking Twitter's "Share", for eg, won't dismiss the sharing dialog.
So, a bunch of developers forked off the original library and now maintain what's called ShareKit 2.0 SDK. If you check the wiki, you'll learn that all new services like Foursquare, LinkedIn, InstaPaper, EverNote have been added to this new version. Happy Coding!

What are established Twitter Libraries for iOS (iPhone & iPad)?

I used to use MGTwitterEngine as my main twitter library for iOS, however, the last commit to the project's master branch is more than one year old (at the time of this writing) and the documentation is not that great. Now I am starting a new project and would like to get rid of the "clunky" MGTwitterEngine, what are other twitter libraries out there for iOS? Which are your favorites and why?
I found the following so far:
MPOAuth
ShareKit (provides a lot more than just Twitter sharing)
Apple announced in the WWDC keynote that Twitter access will be built into the OS in iOS 5, so assuming that means built-in API access its likely that all third-party Twitter libraries are being left to wither. Those who develop for iOS have access to the beta APIs, so even though we can't say anything for sure about future API releases, they could (NDA notwithstanding).
That being said, I'd add DDSocialClient to the list. Like ShareKit it does a whole lot more than Twitter, but it's much less prescriptive on user interface. It restricts itself mostly to the nuts and bolts of the service integration. Whether you think that's liberating or just more work is probably a judgment call.
iOS5 is coming out soon but i'm using MGTwitterEngine and it works like a charm. http://mattgemmell.com/2008/02/22/mgtwitterengine-twitter-from-cocoa
Also you can try sharekit but I dont like it as much.

iOS Development: All I need to do is post a tweet

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.

Facebook iOS SDK too slow

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