Appletell | Apple, Mac, iPhone, iPod | News, Rumors, Reviews, How-Tos

Subscribe to our content for free: (?)
Get our Daily Email

iPhone Developer Intervention Week 2: Twitter and Facebook APIs

by Josh Holat on Apr 7, 2009 at 01:29 PM

XCode IconHello again, everyone, and welcome to week two of the iPhone Developer Intervention.  This week I wanted to talk about some of the Twitter and Facebook APIs available for the iPhone SDK.  API stands for application programming interface, and it allows developers outside of the company to access certain functions and data that Twitter and Facebook make available.  For example, developers can access Twitter tweets through an API, but they don’t have direct access to them. In other words, their access is limited, in a way.  However, the guys at both Twitter and Facebook have created some great APIs to help get started with developing applications for their web apps on the iPhone.

I’ll start with Twitter. Twitter has their own public API available to developers, and Matt Gemmell, a popular developer himself, has made it extremely easy to use that API with the help of Craig Hockenberry, developer of Twitterific. Together, they created MGTwitterEngine, an easy-to-use library of classes providing methods that make it extremely easy for the developer to access the Twitter API.  To show the power of it, for example, this easy to understand function—(NSString *)getFollowedTimelineFor:(NSString *)username since:(NSDate *)date startingAtPage:(int)pageNum—is all that is needed to get all the updates from a certain user. The connection to Twitter and API calls are all done in the background through the MGTwitterEngine files. There is built-in support for direct messages, blocking users, getting updates, getting user information, and almost every other function you would want on Twitter. The total time for me to get this up and running was no longer than 30 minutes.

Next is the Facebook API, which has been made available through Facebook Connect for iPhone. A short while back, Facebook announced their Connect platform for the iPhone, which allowed users to “seamlessly connect their Facebook account and information with your iPhone app” and “share user information and actions on your iPhone app with friends on Facebook.” After downloading the files for this API and adding them to your XCode project, you find that this is extremely easy to use, as well. The only issue I ran into was on the web side with the Facebook Developer application. Using it, you must create Template Bundle IDs that show how you will be updating the users Facebook feed (text, images, etc). Then, you must put that ID number in your app, which can be limited to how the feed is updated. Other than that, though, it was a great experience putting together a simple app using this, as Facebook made it extremely easy. Facebook is a very powerful tool, so it is great to see them helping developers out when it comes to using their platform.

See more iPhone Developer Intervention articles.

Subscribe to keep up with the latest Apple news and rumors! - Subscribe to our feed


Join the Discussion

Name: *

Email: *

Location (Links to Google Maps):

URL:

Enter Your Comment Below...

* Required fields

Remember my information?

Notify me of follow-up comments?

Submit the word you see below:


Special Features