Some tips developing iOS apps with Appcelerator Titanium
I just got my first free app, Khan Archiver, approved under iOS store. It was quite an exciting experience. However, more time was actually spent wresting with Titanium SDK, and waiting for app approval, than development itself.
These are some tricks I learned throughout my struggling and have I known of them before, life would have been much easier
Push your app out for App store review as soon as possible even if you don’t have all the features in place. It’s important to get in the queue and start getting feedbacks from App Store review. Along the way, you may have violated their development guidelines so it’s better sooner than later to find out.
My app got rejected the first time because I tried to store my database/library under “applicationDataDirectory.” Apple implemented an iCloud mechanism that will back up everything under that folder so they only allow critical user-generated non-retrievable information to be stored in that area. Other stuff that can be recreated or downloaded has to be under /Library/Caches/ folder. Appcelerator does not have a variable to access that folder yet. A work around I used is:
var file = Titanium.Filesystem.getFile( Titanium.Filesystem.applicationDataDirectory + "../Library/Caches/" + file_name)
- When I tried to deploy an update for my app, I got a persistent error message 65, even though simulation and install on device work properly. I reinstalled Titanium and XCode but it was still no vail. I then discovered that there were actually 2 distribution certificates in my Keychain Access and the expired one replaced the ‘legit’ one. It turnes out that every time you make a deployment (through Appcelerator at least), XCode will duplicate a random expired certificate to your Keychain Access (weird? I don’t know why). And if you remove the wrong one, you are screwed. Work around: keep your original distribution .cer and remove the old ones in Keychain Access with it.