{"id":864,"date":"2011-02-11T18:15:53","date_gmt":"2011-02-12T00:15:53","guid":{"rendered":"http:\/\/www.philhassey.com\/blog\/?p=864"},"modified":"2011-02-11T18:15:53","modified_gmt":"2011-02-12T00:15:53","slug":"porting-galcon-fusion-to-the-mac-app-store","status":"publish","type":"post","link":"https:\/\/www.philhassey.com\/blog\/2011\/02\/11\/porting-galcon-fusion-to-the-mac-app-store\/","title":{"rendered":"Porting Galcon Fusion to the Mac App Store"},"content":{"rendered":"<p>So, I&#8217;m whipping through the Mac App Store port of Galcon Fusion today.  Most of the documentation on the Apple site is pretty clear, but I&#8217;ll document the few stumbles I had in case it helps anyone else.  Thankfully a few web searches found the answers to most of my questions pretty quickly.<\/p>\n<p><b>1. The Certificate file selected is invalid<\/b><\/p>\n<p>While using the App Store Developer Certificate Utility I got this error message \u201cThe Certificate file selected is invalid\u201d .. The problem was I was using Chrome.  By switching back to Safari to finish the web-wizard, I got past this error in a few moments.  <a href=\"http:\/\/stackoverflow.com\/questions\/994761\/iphone-developer-portal-wont-accept-my-csr\">Original article.<\/a><\/p>\n<p><b>2. Unable to copy dSYM file into archive<\/b><\/p>\n<p>While attempting to Build and Archive my app I got the error &#8220;Unable to copy dSYM file into archive.&#8221; with the suggestion that I &#8220;Please make sure that your application has set the \u201cDebug Information Format\u201d build setting to \u201cDWARF with dSYM File\u201d.&#8221;  I also confirmed that &#8220;Generate Debug Symbols&#8221; was checked.<\/p>\n<p>I had already made this change, and I double checked it via Project > Edit Project Settings > Build > .. However, this didn&#8217;t seem to fix it, so I did a search and found <a href=\"http:\/\/www.cocoabuilder.com\/archive\/cocoa\/296746-build-and-archive-fails-due-to-missing-dsym-file.html\">this article<\/a>.  I found it to be somewhat cryptic, but I went and tried Project > Edit Active Target > instead.  I found the &#8220;Generate Debug Symbols&#8221; was unchecked from this view.  If anyone knows the difference I&#8217;d appreciate understanding what I was doing right \/ wrong here.  Anyway it now &#8220;Build and Archive&#8221; without any trouble.<\/p>\n<p><b>3. The use of non-public APIs is not permissible, as documented in section 2.5 of the App Store Review Guidelines.<\/b><\/p>\n<p>&#8220;Using private APIs can lead to a poor user experience should these APIs change in the future. The non-public API (CPSEnableForegroundOperation, CPSGetCurrentProcess, CPSSetFrontProcess) that is included in your application comes from the following private Apple frameworks &#8211; ApplicationServices.framework.&#8221;<\/p>\n<p>Okay, this hasn&#8217;t actually happened to me, it happened to <a href=\"http:\/\/toonormal.com\">Mike Kasprzak<\/a>.  He found that SDL had an #ifdef in its SDLMain.m which enabled some undocumented APIs being used.  By commenting out &#8220;#define SDL_USE_CPS&#8221; he was able to resubmit and avoid the rejection notice.  Mike also mentioned that SDL 1.3 doesn&#8217;t have this issue, but it&#8217;s still in beta and somewhat incomplete.<\/p>\n<p><b>4. After trying to manually install my app, it didn&#8217;t appear in \/Applications<\/b><\/p>\n<p>After using the Organizer to Share > Save As .. > my app, I used the command line &#8220;install&#8221; command to try and install it.  My app didn&#8217;t appear in \/Applications.  It didn&#8217;t seem to go anywhere sensible.  I found that to force it to go to \/Applications you just have to manually delete all the other places it tries to install it, and eventually when it can&#8217;t find your app anywhere to overwrite it, it&#8217;ll install into \/Applications properly.<\/p>\n<p><b>5. Adding support for CMD-Q and CMD-F<\/b><\/p>\n<p>One thing I had to do was add support for standard Apple command keys.  I guess it&#8217;s about time!  Mike tipped me off that Apple checks for those and I&#8217;d best have them properly supported in my app.<\/p>\n<p><b>6. Adding receipt validation<\/b><\/p>\n<p>I implemented some receipt validation, but upon trying running my application I got this error:<\/p>\n<p>&#8220;This is not a Test User account. \/ Please create a new account in the Sandbox environment. [Environment: Sandbox]&#8221;<\/p>\n<p>I found <a href=\"http:\/\/www.garagegames.com\/community\/forums\/viewthread\/124171\/1\">this tip<\/a> on a website: &#8220;(You can) create a test user in iTune connect by logging on iTune Connect &#8211;> Select Manage Users &#8211;> Test User &#8211;> Add New User &#8211;> Fill in the required data for your test user. We will be using this test users to see if our receipt validation code is working properly.&#8221;<\/p>\n<p>Apple strongly encourages obfuscating your code for the receipt validation.  I&#8217;m no expert on this, but I heard that using blocks helps.  This <a href=\"http:\/\/thirdcog.eu\/pwcblocks\/\">article<\/a> showed me the blocks syntax, which I found pretty easy to pick up.  (Blocks are a sort of lambda for C code.)<\/p>\n<p><b>7. Submitting the app<\/b><\/p>\n<p>When submitting I got a variety of incoherent error messages.  Bottom line is you can&#8217;t have spaces in your package name.  Basically in Organizer you have to save to disk with a name with _&#8217;s instead of spaces then upload using the application loader.  Here&#8217;s <a href=\"https:\/\/devforums.apple.com\/message\/336967#336967\">the thread<\/a> that explains it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, I&#8217;m whipping through the Mac App Store port of Galcon Fusion today. Most of the documentation on the Apple site is pretty clear, but I&#8217;ll document the few stumbles I had in case it helps anyone else. Thankfully a few web searches found the answers to most of my questions pretty quickly. 1. The [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-864","post","type-post","status-publish","format-standard","hentry","category-galcon"],"_links":{"self":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts\/864","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/comments?post=864"}],"version-history":[{"count":7,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts\/864\/revisions"}],"predecessor-version":[{"id":871,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts\/864\/revisions\/871"}],"wp:attachment":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/media?parent=864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/categories?post=864"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/tags?post=864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}