Book Image

Flash iOS Apps Cookbook

By : Christopher Caleb
Book Image

Flash iOS Apps Cookbook

By: Christopher Caleb

Overview of this book

The latest version of Flash Professional can directly target iOS, allowing Flash developers to write applications that will run natively on Apple's iPhone, iPad, and iPod touch. What's more, with Apple loosening its restrictions on third-party technologies, apps written in Flash can now be sold and distributed within the App Store.Flash iOS Apps Cookbook provides the recipes required to build native iOS apps using your existing knowledge of the Flash platform. Whether you want to create something new or simply convert an existing Flash project, the relevant steps and techniques will be covered, helping you achieve your goal.Learn how to configure and use Flash Professional for iOS development by writing and deploying a simple app to a device. Implement many iOS-specific features such a multi-touch, the virtual keyboard, camera support, screen orientation and the Retina display. Overcome the limitations of mobile development by mastering hardware acceleration and optimization. Whether you're an enthusiast or professional developer, the Flash iOS Apps Cookbook is your toolkit to creating high-quality content for iPhone, iPad and iPod touch.
Table of Contents (21 chapters)
Flash iOS Apps Cookbook
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a P12 certificate using Mac OS X


Now that you have downloaded your development certificate from the Provisioning Portal, the final step is to convert it to a P12 certificate file.

Flash Professional will use this P12 file to digitally sign any iOS apps you create.

The process for generating a P12 certificate file differs depending on your choice of operating system.

The steps for Mac OS X are covered here. If you are using Microsoft Windows, then refer to the Creating a P12 certificate using Windows recipe.

Getting ready

You will need the development certificate that you created and downloaded from the iOS Provisioning Portal. If you haven't already done this, then follow the steps outlined in the Obtaining your development certificate recipe.

How to do it...

Execute the following steps:

  1. Launch the Keychain Access application from the Applications/Utilities folder.

  2. Select File | Import Items (Shift + Cmd + I) from the drop-down menu. From the file browser, select your certificate from Desktop/developer_identity.cer.

  3. Your certificate will be installed in the Keychain Access application. You can confirm this by clicking on the Certificates category where you will see your iPhone Developer certificate listed.

  4. Now, select the Keys category and find the private key associated with your certificate. Both your public and private keys will be listed and named using the name you entered when creating your CSR. This is shown in the following screenshot:

  5. Context-click on the private key and select Export. A dialog box will appear asking you to specify where to save the P12 file when it is created. Choose the desktop and click on Save.

    Tip

    Take care to context-click the private key and not the public key. You can check by looking for private key listed in the Kind field next to each key.

  6. Keychain Access will ask you to specify an export password. Flash Professional will prompt you for this password while compiling your .swf files into native iOS apps, so choose something you aren't likely to forget. Enter your password and confirm it by re-entering it into the Verify field and then click on OK.

    Note

    You may also be prompted by Keychain Access to enter your Mac's login password. If so, do this and click on Allow to grant Keychain Access permission to export the key.

    If successful, a P12 certificate file will be created and saved to your desktop.

    It is important you keep this file safe as you will need it to publish any of the examples in this book.

  7. Using Finder, navigate to your Documents folder and create the following folder structure within it: packt/flash-ios-cookbook/developer-files/.

  8. Copy your P12 file to this new location. We will keep it here from now on.

How it works...

When publishing iOS apps from Flash Professional, you will be prompted for your P12 certificate file and password. Both are used to digitally sign your app allowing it to be deployed and tested on an iOS device.

The P12 certificate is the first of two files that will be used by Flash Professional every time you make an iOS build.

Tip

Testing without a device

If you decide to test from the AIR Debug Launcher (ADL) rather than deploying to an iOS device, then a P12 certificate file isn't required.

There's more...

Finally, a few additional words regarding certificate expiration.

Certificate expiration

When your developer certificate eventually expires you will need to request a new one from the Provisioning Portal before converting it to a P12 file. Any apps that were published using the old certificate will no longer run on your iOS device and will need to be republished using a new valid P12 file.

If you accidentally delete your existing P12 file, then you can simply recreate it from the steps outlined in this recipe. There is no need to request a new development certificate from the Provisioning Portal.