Code Signing with XCode

Code signing is an important task in order to test your app on device and to distribute as an adhoc distribution or app store. Before that you must have created a provisioning profile. If you do not know how to create one, please refer to this post.

  1. Open your xcode project
  2. In left sidebar, click on project name
  3. Select target
  4. Select build setting tab
  5. Locate Code Signing section
  6. In Code Signing Identity, select provisioning profile only for Any iOS SDK
  7. For DEBUG, use development profile. For RELEASE use distribution profile

How to change icon and splash screen in Titanium

Locate the icon and splash screen files in Resources/iphone/ folder. Replace the files with the new one you have.

  • appicon.png : this is app icon file. Size: 57 x 57, 114 x 114 (retina), 72 x 72 (iPad).
  • Default-Landscape.png : splash screen for iPad landscape mode. Size: 1024 x 748.
  • Default-Portrait.png : splash screen for iPad portrait mode. Size: 768 x 1004.
  • Default.png : splash screen for iPhone and iPod Touch. Size: 320 x 480.
  • Default@2x.png : splash screen for iPhone and iPod Touch retina. Size: 640 x 960.

Reference: Custom Icon and Image Creation Guidelines

How to run Titanium iOS app on device

In order to test your app on device and distribute to App Store, you need to enroll iOS Developer Program. It cost USD $99 per year.

Once you have joined iOS Developer Program, you need to register your app and devices in iOS Provisioning Portal.

Before we begin, we need to prepare WWDR certificate, Develop certificate, register App ID, add devices and create Provisioning Profile. All of them we can do by using iOS Provisioning Portal.

  1. Get WWDR certificate and development certificate. Open iOS Provisioning Portal. Click Certificates. In Development tab, you will get the download links for them. Double click each of certificate file in order to add them into KeyChain.

  2. Register App ID. Click App IDs, then click New App ID.

  3. Add devices. Click Devices, then click Add Device. Here you will need to enter Apple Device ID (UUID). If you do not know the UUID number, connect your device to your mac. Open Xcode > Window > Organizer. In Organizer, click your device. There will be identifier value in the main screen. While in this main screen you can also add your device to iOS Provisioning Portal by clicking Add to Portal in the bottom screen.

  4. Create provisioning profile. Click Provisioning then click New Profile. Fill the profile name, developer certificate, App ID and select the devices. After it is created, download the profile file then double click it to update the KeyChain.

Ok. Now the preparation is completed. We are back to Titanium Studio.

  1. Click Run button in the project window. Select iOS Device.

  2. Click Upload provisioning profile. Select provisioning profile file you have downloaded.

  3. Make sure your device is connected via USB. Click Finish. It will start building the project. Wait until it is finished then iTunes will automatically synch the app. Your app will be run automatically on your device.

Quick start guide how to run Titanium distribution files from dodyrw.com

If you have received Titanium distribution file from me (WpApp or custom work project), you will notice I only include files in /Resource folder. There is no project file so you must create it by yourself. By excluding the project files, you are free to customize the project detail.

Here is a quick start guide how to setup and run a project.

  1. Open Titanium Studio. Make sure you have Xcode installed. If it is Android project, make sure you have installed Android SDK.
  2. Create a new mobile project.

  3. Delete Resource folder and copy paste from distribution file.

  4. Click Run button, it will open iOS Simulator.

How to setup apple push notification with Urban Airship

In this tutorial we are going to setup apple push notification with Urban Airship. I assume you already have an account with them.

  1. Create a new app
  2. We will fill what is mandatory for APN.
    • Enter the Application Name
    • Enable the check box for Push Notifications Support
    • Select file for Apple push certificate

  3. If you use WpApp, you will need the Application Key and Application Master Secret. Fill these values in WpApp WordPress Plugin.

That’s it. Now you are ready to use APN service using Urban Airship.

How to generate PKCS12 file for apple push notification

There are some steps in order to enable Apple Push Notification (APN) service. We need to enable it in iOS Provisioning Portal and then generate .p12 file. This tutorial will cover how we do this.

  1. Go to iOS Provisioning Portal, select App IDs

  2. You will see Apple Push Notification service will be in yellow color by default. It mean disabled. You need to enable it. Click configure.
  3. Enable the checkbox for Enable for Apple Push Notification service in the left top corner. Then click configure button.
  4. Prepare a Certificate Signing request (CSR) file. If you do not have it, generate it using Keychain. Keychain Access -> Certificate Assistant -> Request a Certificate From a Certificate Authority.

  5. Back to iOS Provisioning Portal. Click configure, select Next. Here you will be asked to upload CSR file you have generated above. Select the CSR file then click Generate.
  6. Now the certificate has been generated. You need to download it.
  7. Locate and double click the aps_developer_identity.cer file you have downloaded. It will open Keychain. You should be able to see that now you have a new valid certification for iOS Push Services.
  8. While iOS Push Services certificate selected, right click mouse or tap the touchpad with two finger. Select Export. It wil export to .p12 file. If it ask the password, leave them empty. The second password popup dialog is the password for your mac account, you need to fill it.

Now we have .p12 file that we will need for APN service like Urban Airship. If you check again the iOS Provisioning Portal, you will notice that now we have green color for Apple Push Notification service.

WpApp 2.0 update

The most important feature in this update the use of Apple Push Notification (APN) service. I decide to use Urban Airship service to deliver APN. The service alone is free but it is enaouh for small to medium size wordpress blog.

There is Urban Airship module for Titanium in Appcelerator marketplace, it cost $30/month. Fortunately we will not use this module. WpApp does not require this module, so we can save the money for other modules. We use the kitchensink demo to use APN with Urban Airship.

Other updates:

  • When twitter post is clicked, it will open webview and load twitter mobile web.
  • Adding new tabs for facebook, youtube and flickr. To make it simple, they are just a webview that load the mobile web version. However it look pretty and useful too.
  • Change the icons, use free version of glyphish.

Here are some screenshots: