I found this post to be very informative, and possibly helped to prevent my App from being rejected the first round (I had enabled constant vibration while the player was under attack).
I found this post to be very informative, and possibly helped to prevent my App from being rejected the first round (I had enabled constant vibration while the player was under attack).
I checked around the net and found some people looking for this, but nobody who actually posted a code example. So here it is, code to make your Ad Mob ad shift to landscape orientation. My code makes it appear on the bottom, enlarged a little bit, with the device rotated to landscape counter-clockwise.
Add in a UIView called adContainer in your delegate interface declaration, and then update the standard Ad Mob methods as follows.
- (void)showAd { adMobAd = [AdMobView requestAdWithDelegate:self]; // start a new ad request [adMobAd retain]; // this will be released when it loads (or fails to load) adContainer = [[UIView alloc] initWithFrame:CGRectMake(0, 432, 320, 48)]; }
#define degreesToRadians(x) (M_PI * x / 180.0) - (void)didReceiveAd:(AdMobView *)adView { [adContainer addSubview: adMobAd]; [window addSubview:adContainer]; CGAffineTransform makeLandscape = CGAffineTransformMakeRotation(degreesToRadians(90)); makeLandscape = CGAffineTransformTranslate(makeLandscape, -480/2 + 48/2, 320/2 - 48/2 - 12); makeLandscape = CGAffineTransformScale(makeLandscape, 480.0/320, 480.0/320); adContainer.transform = makeLandscape; autoslider = [NSTimer scheduledTimerWithTimeInterval:AD_REFRESH_PERIOD target:self selector:@selector(refreshAd:) userInfo:nil repeats:YES]; }
- (void)removeAd { [adMobAd removeFromSuperview]; [adMobAd release]; adMobAd = nil; [adContainer removeFromSuperview]; [adContainer release]; adContainer = nil; }
This was actually my first experience using the CG transforms, so please be gentle if there’s a better way
.
I spent more time trying to get Ad Hoc distribution work than any other issue that should have taken 15 minutes. There are a number of things which can go wrong, some of which are ridiculous and Apple will no doubt fix in time, but for now you should know these:
The biggest gotcha: you can not use the “Compress” option in Finder to bundle the Ad Hoc package. It adds files that cause iTunes to freak out. I wrote a quick shell script to bundle everything up and zip it together using the command line zip tool.
mkdir Payload cp -rp MyApplication.app Payload/ zip -r MyApplication.ipa iTunesArtwork Payload
This way, you can give people the .ipa and .mobileprovision file. Tell them to drag the .mobileprovision into iTunes, and then double click the .ipa. How easy was that?
Another semi-obscure fact: iTunesArtWork is a 512×512 png, named simply ‘iTunesArtwork’ without the extension that needs to be included ONLY with Ad Hoc copies so the icon shows up in the iTunes window. You don’t need to include it, but if you do make sure you only do so when sending out Ad Hoc copies.
One more thing that caught me over and over again: don’t forget to increment the version number in your info.plist file before giving Ad Hoc users a new copy! iTunes is really sneaky about what happens here…in both cases it says the application is already installed, and asks if you want to replace it, but if you try to replace with the same or lower version number, it won’t actually do anything.
If you are getting
Application was not installed on the iPhone because it could not be verified.
then your profile isn’t valid and you should check out this post. This biggest thing to remember is
~/Library/MobileDevice/Provisioning Profile.Lastly, ensure not only that Entitlements.plist is included in your project (click File, New File, Code Signing, Entitlements), and that get-task-allow is unchecked, but in your “Ad Hoc” build profile (Project, Edit Active Target) expand the list to “All Settings” make sure the “Code Signing Entitlements” field is filled out with your “Entitlements.plist”.
The new homepage for the game is located at http://johnehartzog.com/projects/stickwars/
Before I took it down today, StickWars – Siege was ranked #19 in iTunes Paid Apps section, of all apps. Pretty cool! Hopefully the re-release will see the popularity increase even more
.
Please post any bugs at http://johnehartzog.com/forum/viewforum.php?f=4.
If you have any feature requests or suggestions, throw them up at http://johnehartzog.com/forum/viewforum.php?f=5.
If you are just starting out on iPhone development, or are considering starting but don’t feel like dropping $99 without getting your hands wet first, then you’ll need to jailbreak your device.
For me, this was great at first as it was far easier to set up than XCode provisioning profiles, and it let me see if I was felt confident enough playing around in Objective C to really take the dive and pay for a developer account.
In case you somehow don’t know where to jailbreak, head to Dev-Team Blog and download the appropriate torrent.
A quick note: I own one of the new Aluminum MacBooks and still have not successfully jailbroken my iPhone using it, due to some error/bug/whatever with the USB drivers failing to put the device into DFU mode. Just find a windows computer to use for 15-25 minutes and use QuickPwn on it.
After you jailbroken your device, you still need to do some tricky steps to get your own compiled iPhone app running on your device. You can find a walkthrough of how to do this here.
By far the most helpful single resource I found during the long and difficult course of properly signing my code and getting it running on my iPhone is locaded at 24100.net. And the title of the post is very helpful, because those two errors, 0xE800003A and 0xE8000001, are the curse of provisioning on iPhone development.
To sum up my own experience with XCode signing, I learned a few things which have really improved my development experience.
After spending all day playing my game to the high levels with my iPhone tethered up to my laptop, testing for all manners of bugs, I finally feel that I’ve made enough progress to warrant losing my spot in the queue and resubmitting my binaries.
I redid the way the game alerts you when you are under attack. The way I had it before, it would tend to spam you with vibrates, especially later on in the game, and I hear Apple dislikes that a lot. Now, it still plays the knocking sound, but only vibrates if your health is too low, or is being lost at a rate fast enough to make you lose in under a minute. This seems long, but it’s nice for later in the game when you don’t care if you have 10 stickies pounding at your wall, as you have 10,000 hp and are saving your bombs for the waves of 40 at a time.
The game is really smooth now, my girlfriend played it for an hour up to level 25 without any crashes or bugs. That’s a new record.
After this I’m going to sit and wait. The game is stable enough in my eyes that Apple won’t reject it for that reason, but if something else bothers them I don’t want to waste any more time adding new content until I get a green light.
And by sitting and waiting, I’m going to start the school work that I have not been doing for…about 3 weeks now (although one of those WAS spring break).