Here are instructions for getting Mobclix installed into your iOS project. Ive done this by modifying the exported iOS project code directly. Specifically, I have replaced the two source files that control iAds with new code that controls Mobclix. Most of the functions in the iAds library had analogues in the Mobclix SDK, so the conversion wasn't too bad.
This is a hack, not a clean solution. Use at your own risk.
To start, sign up for a Mobclix account. Download the SDK, and read their getting started guide. In particular, you will need to add the SDK folder to your Xcode project, and you will need to associate a few more frameworks with your project. Make sure to clean your build if things dont work out.
Next, you'll need to replace two of Clickteam's code files with new versions I have prepared. Attached to this post, you'll find new versions of CIAdViewController.h and CIAdViewController.m
In your Xcode project, inside /Classes/Application, backup the old versions of these files, and drop in these new replacements.
Next, in the CIAdViewController.m, you'll find an initialization function with my personal Mobclix ID for a test app Im working on. Feel free to use this ID for testing/development purposes, but DO NOT distribute this ID or any software with it. If you want to use your own ID, register a new App and get an ID through the Mobclix dashboard. Furthermore, make sure to activate all the banner sizes you want, and enable test mode on them until you signup for actual ad services.
Next, in the source code, uncomment the particular banner size you want to load up.
This mostly seems to work, but I have NOT done extensive testing. Test banners appear in the right spots on the screen, but I haven't signed up for real ad services yet. Pause/Resume of the runtime seems to work when I click on ads.
I do NOT know if the Mobclix ad refresh timer is getting properly paused when the application is no longer on the screen. There are a series of functions at the bottom of my source file that are supposed to handle cases in which the view is not visible, but I do not know if they are getting called. Perhaps someone with more Objective C experience can give pointers. If anything, I wish I could print something to 'standard out' to see when these are executing....
EDIT: Just learned how to print to stdout - and indeed these calls are not executing, ever, it seems .... might not be a problem though ... stay tuned
To those of you who want Mobclix, and have ObjC coding experience, please read my code and compare it with the old code. Read my comments to see what I'm not confident is working correctly. I only have 1-week of experience doing ObjC, so I'll need help testing and validating this code.
This is 80% done - lets finish it.
* Mobclix doesn't yet handle iAds automatically on iPad, so I probably wont be using this on my universal apps just yet. To get iAd working, we need to have more complicated code that tries iAds first and then calls mobclix as a backup. I dont know how to do this yet. I think it will need 2 separate view controllers ... and Im although Im sure we can use the
didFailToReceiveAdWithError method to call Mobclix, Im not sure how to return to iAds at a later time.
* I haven't tried this on an iPhone yet, nor have I tried portrait orientations. Landscape orientations on an iPad work well!