Search VG Five
History

Entries in ios (2)

Thursday
Sep292011

cocos2d 2.0.0 Interface Rotations

I was playing around with the alpha release of cocos2d 2.0.0 and got caught on trying to get the screen to rotate properly to landscape mode. After a bit of searching, I came upon the following line in the release notes:

[NEW] Director: Orientations are no longer supported. Only Portrait mode is supported. Use a ViewController to rotate the EAGL view.

What exactly does this mean? A little more digging found this post and the subsequent response which cleared it up for me.

How to configure your app's supported orientations in cocos2d 2.0.0:

If you're using the cocos2d templates in XCode, you'll want to open up RootViewController.m and look for the following:

Simply uncomment out one of the three lines by folliowing the comments, and your app will automatically only support those orientations. Simple as pie.

Stuck on any part of iOS, cocos2d, or general Objective-C development? Leave a note in the comments and I'll try to address any issues in future posts.

Wednesday
Mar092011

iOS Resources for Migrating to Foursquare API v2

Alkatracks is truly my first foray into a "socially connected" iOS app. While I have dealt with webservice feeds and XML before with iGoozex, for Alkatracks I not only had to write my own backend webservice but also connect the app and its users to Facebook's and Twitter's OAuth-enabled services. While I spent plenty of time working through the authentication process for those two services, I only needed rudimentary support for Foursquare in order to access the nearby venues for sharing them while drinking.

This caused the first "Whoops!" moment that I encountered with Alkatracks being live. Yesterday morning, Foursquare was unavailable for a few hours, but the only notification I had was that users were not able to list nearby venues. A little digging revealed that they were receiving a rate limiting error from Foursquare. I investigated further and realized that while there was nothing I could do to reduce occurances of this without pushing an updated version to the App Store approval chain, there were quite a few changes over at Foursquare's API since I had last touched it in mid-2010.

Foursquare has moved to what they dub "v2" of their API recently, and there is no better time than the present for me to move Alkatrack's codebase up to their current API. Alkatracks v1.0.1 is currently in the App Store review queue, and with it will come a much more reliable implementation of the Foursquare venue search.

For those of you out there in dev-land that want to use these new features in your own iOS apps, it's as simple as cloning the (official?) foursquare-api-v2 repo from github [github.com]. You may also be interested in foursquare-oauth-iPhone [github.com]. If you'd be interested in a quick tutorial on getting an app up-and-running with Foursquare authentication and checkins, etc., please leave a comment and let me know!