Archive

Archive for the ‘Game Development’ Category

Opening App Store in iPhone without Safari

September 28th, 2009

A week or so ago, we were working on a free Brainy Smarty Party Lite version of the game, and bumped into a bit annoying thing. Lite version has a screen, describing full version of the game, and a link, which opens game’s page in App Store. The annoying part is, that after you press a button, instead of opening App Store directly, it actually opens Safari browser, which in turn redirects to a bunch of other URLs, and then launches App Store. Whoa… so much action for such a simple thing! As always, all knowing Google helped to solve the problem. And solution was… erm… interesting. :-D

URL that opens application in App Store is this: http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=326683049&mt=8. Now, to fix the problem, all you have to do is change “itunes” part to “phobos”, so the URL would look like: http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=326683049&mt=8. Sometimes you wish all the problems could be solved like that! Code for opening an app in a webstore is here:

 NSString *buyString=@"http://phobos.apple.com/WebObjects/" \
   "MZStore.woa/wa/viewSoftware?id=326683049&mt=8";
 NSURL *url = [[NSURL alloc] initWithString:buyString];
 [[UIApplication sharedApplication] openURL:url];
 [url release];

So, the annoying thing was fixed, and BSP Lite is on it’s way to App Store! Hopefully Apple will approve it soon. Fingers crossed. ;-)

Smilediver Game Development

iTunes Connect submission battles

August 10th, 2009

Probably there’s nothing more demotivating than bumping right into invisible wall just in front of the finish line. And this just happened with our first game. We have finally assembled it’s master build, prepared it for iTunes Connect submission and with great disappointment had to find out that the build gets rejected with a weird error when uploading.

Yes, we are one of those unlucky that had to deal with: “The binary you uploaded was invalid. The signature was invalid, or it was not signed with an Apple submission certificate.” error. After a quick googling around, it was apparent that behind this error was a billion of different things that could be wrong. Some people were lucky with just rebuilding their projects, some found out that you can’t use spaces for the build’s zip file, others forgot to include app icon in proper format and so on.

In our case error was triggered by a couple of files beginning with “._”, or more exactly two  “._resources.xml” files. I have read about “._” problem in one page from Google search results, but quickly dismissed this case, since our project didn’t used such files and a quick file search in the build’s zip file found nothing. But… after a lot of messing around, I’ve noticed that signature file (_CodeSignature/CodeResources) actually contained lines for non existing files like:

<key>Games/General/Config/._resources.xml</key>
<data> 
D4z0McjugF22KhX0wp+ZjJ1MK9Q=
</data>

Looking at the above it was obvious were the problem was. Game’s source “Games/General/Config/” directory had our original “resources.xml” file and also “._resources.xml”. Now, I’m not sure why these “._resources.xml” files were there. It seems that they either were auto generated by Xcode or Mac OS X itself. Anyway, after this we quickly fixed it and upload went well!

So if you run into similar problem, do a search for files beginning with “._”. Also get ApplicationLoader from iTunes Connect site, and run it from the console. It will give a bit more detailed report about the error in the console. Though, in this case error message was very vague too, and didn’t helped much.

Looking back at it now… maybe all this mess was a good thing, because during the process we found another two bugs. ;-) And… as you can guess, we are near the launch of our first game! Hopefully submission process will be much more smoother.

Smilediver Game Development