You’re ready. Your app has been tested on emulator and on device. Now, you’re ready to make the leap to post your app to the Apple App Store. I admit to looking back on the lazy summer days when you could take your Corona SDK app and build it for the app store, grab Application Loader, and post it right over. NativeScript is a different beast. It’s really more like native development in its tooling around pushing your app to production, and I’m going to walk you through some tips and tricks to smooth your way, as I just pushed an update for my ThisOrThat app.
Note, supposedly app reviews are now taking less time, not 7 days but more like 2 or 3. We’ll see!
1. Get your provisioning profiles sorted.
I have a system where I have one certificate installed on my local computer and one development (ad hoc) certificate and one production (distribution) provisioning profile available. I name them something like thisorthat_dev and thisorthat_prod. I also create an app id for each app in the Apple Developer Center, just to keep everything organized. If you deal with this early in the development process, you’ll be thankful at the end when you just want to publish the darn thing.
2. Make sure your icons and splash screens are right
I design my icon using graphics from VectorStock and use Fireworks to save a .png file in 1028×1028 size. Then, I put that icon through makeappicon.com. For splashscreens, you can use a service such as Telerik Platform (until the Brosteins service is ready) to create a big splash screen and then resize it. Get this stuff done early.
3. Get your app store listing ready.
This is such an important thing to get right. You need to concentrate on the artistic and SEO-friendly aspects of your app presentation. Use a tool like LaunchKit.io (just buy a $99 subscription if you can at all, it is totally worth it) to create beautiful screenshots. Don’t bother with an app video unless your app is a game or something with a lot of animations. Optimize the heck out of your title, keywords, and description; tips are in my article on this subject. Set your app to have everything input except for the final upload of the actual app, and you’ll be ready to go for these last steps.
4. Ready? Sorry, but it’s time to open Xcode.
Using the NativeScript CLI? You can use `tns publish ios` commands to publish straight from the CLI. However since I encountered a bunch of errors, as you’ll see, I found using the Xcode route (without even using Application Loader) seemed to work best as it’s easier to narrow down mistakes and problems due to the GUI.
First, navigate to your platforms/ios folder and open the .xcworkspace (not the xcodeproj) file.
Click on the project name and then Build Settings. Make sure that your provisioning profiles are correct for the production build that you are going to use.
Make sure that your build dropdown is set for “Generic Device” rather than anything you have plugged into your computer:
Go to Project and click “Archive”. There will possibly be a bunch of errors. Let’s get through them!
5. Fix all the crazy!
The archive process may not go entirely smoothly. You may encounter errors. We tend to find problems in particular with icons and splash screens.
Errors with icons
You can fix icon problems one of two ways. One is to edit the Info.plist that you can store in your App_Resources/ios folder so that it will be copied during the build process. This is my preferred method, although NativeScript engineering prefers the other way using asset catalogs (which is described here and here) (I don’t like this because I find the GUI for the icons and splash screens awful in Xcode). Go ahead and use Sitefinity Steve’s edit suggestions to your app’s Info.plist file. Make sure you include icons of size 72, 120, and 154, as sometimes you’ll find build errors associated with these icons missing.
Errors with splash screens
Your build process may be stalled with problems associated to the splash screens (launchscreens). Again, copy the Info.plist changes Steve makes, above. Click on the app’s ‘Target’, then ‘General’ in the top tabs and ensure that you’re not using Asset Catalogs (you can if you want to, I just don’t like the GUI)
Here are my final splash screens:
Support your iPad customers!
You’ll get an error about ‘multitask support’, but you can get around it by forcing your app to always be full-screen. To do this, check ‘requires full screen’ in the Targets > General screen:
Once you archive the app successfully, you’ll want to upload it to the store. You’ll be presented with this screen:
Make sure to uncheck the bitcode box. If you don’t, you’ll get more errors and who needs it, at this point.
Send that app to the store!
And finally get the screen of joy! Don’t forget to visit the Apple Developer center to complete your app submission and set it to ‘waiting for review’
Next stop… Android.