Friday 8 January 2010

New DoodUrls iPhone App nearing beta

Well, it's only taken, what, 3 or so months, but I just began implementing new features in to the iPhone DoodUrls App. We now have picture submission!!! This is pretty exciting as I believe that one of the things that will boost DoodUrls popularity is a simple way to submit pictures.

Implementation is dead simple, but wasn't easy to get to! Adding the Camera to the app proved to be fairly straight forward. I needed to mess about with views to get the second view containing the camera to appear, but that was more a lesson going with my gut instinct rather than following examples in books.

The TwitPic submission was very simple. The author of the open source Twitter App, Canary, had already created a class called "ORSTwitPicDispatcher", which handled the TwitPic API call "upload", so I simply implemented the "uploadAndPost" call by adding an extra param and passing that as the message in the http request. All worked well in the Simulator, but the device didn't want to know at all! I googled the issue - it seems the NSXml* classes are somewhat lacking on the iPhone device, but present for the simulator (aka GAH!) Luckily, some nice developers have created an almost drop in replacement (well, in my circumstances it was a drop in), called TouchXML (Google it!) After making sure libxml2 was being referenced and the headers for it were being found, we were down to 2 errors!! I had taken the liberty to update AdMob to the latest version, and they now require more frameworks. After clocking this I added the MediaViewer framework and AudioToolBox and it all compiled!!

Everything then worked, except the Camera!! It seems that you now need to implement both

- (void)imagePickerController: (UIImagePickerController *)picker didFinishPickingMediaWithInfo: (NSDictionary *)info;

*and*

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo;

GAH!! The Camera Roll and Library use the second callback, but the camera now uses the former!! Without both my code only worked one way or the other, but with both everything was happy!

So it is down to tinkering now. Hopefully a submission in the next 7 days ;-)

No comments:

Post a Comment