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 an App ID


Every app you write must be assigned an App ID, which is a unique identifier used by iOS.

There are two types of App IDs: Explicit App IDs and Wildcard App IDs. To ease development, you can use a wildcard rather than an explicit App ID. This removes the need to generate an ID for every single app and will be particularly useful when it comes to working through and testing the examples within this book.

Let us create a wildcard App ID that can be used across multiple apps.

How to do it...

Execute the the following steps:

  1. Log into the iOS Dev Center at http://developer.apple.com/devcenter/ios and make your way to the Provisioning Portal.

  2. Move to the App IDs section by clicking on the link on the left-hand side of the Portal's home page. Ensure that the Manage tab is selected. From this page, you can add new App IDs and view any that you previously created.

  3. On the far-right side of the page, across from the App IDs heading is the New App ID button. Click on it to be taken to the Create App ID page.

  4. A common name should be assigned to every new App ID. This is used throughout the Provisioning Portal to identify that App ID. Enter General Development into the text field directly below the Description heading.

  5. Now you can create the App ID. Enter * into the Bundle Identifier text field. Your Create App ID page should resemble the following screenshot:

  6. Click on the Submit button at the bottom-right of the page. You will be taken back to the App IDs page where you will see your newly created App ID listed in a table.

How it works...

An App ID is a unique string used to identify an app (or multiple apps) from a developer or team.

It consists of two parts: a Bundle Seed ID and a Bundle Identifier. The Bundle Seed ID is a universally unique 10-character prefix generated by Apple. The Bundle Identifier is a unique suffix determined by yourself, which can include the wildcard symbol "*".

When compiling an iOS app from Flash Professional, you will need to choose an App ID you want associated with your app and provide it to Flash. Although you will be asked to submit the App ID as part of the publishing process, you actually only provide Flash with the Bundle Identifier portion of the App ID.

If your Bundle Identifier contains the wildcard character, then you will need to substitute the wildcard with an arbitrary string that will uniquely represent your app. If a wildcard has not been used, then you will have to specify the Bundle Identifier exactly as it was entered into the Provisioning Portal.

The benefit of a wildcard is that it allows you to create a single App ID that can be used with any application you develop. This will be particularly useful when working through this book as it removes the need to revisit the Provisioning Portal to create a unique App ID for each recipe.

There's more...

The App ID you just created by following this recipe's steps is all that is required for working through the examples provided within this book. However, you may find the following additional details useful for your own personal projects.

Bundle Identifier naming convention

Although we used a single asterisk to represent the Bundle Identifier, Apple's recommended practice is to use a reverse-domain name style.

You should be familiar with this naming convention as it is commonly used for naming packages in ActionScript and helps prevent namespace collisions; a domain name can only be owned by an individual or organization.

Take, for example, the domain name yeahbutisitflash.com. Rather than using a single asterisk, an App ID can be created that will work across multiple apps by using the following Bundle Identifier: com.yeahbutisitflash.*.

To use this App ID to publish multiple apps from Flash Professional, provide Flash with the full Bundle Identifier but replace the asterisk with a unique string of your choice for each of your apps.

For example, if you are working on two individual test apps, then you could specify to Flash that the first app's ID is com.yeahbutisitflash.test1 whereas the other's could be set to com.yeahbutisitflash.test2.

Both apps are still using the com.yeahbutisitflash.* ID registered in the Provisioning Portal, but the wildcard has been replaced in each with a unique string that distinguishes the apps from one another.

App distribution

An app that is ready for distribution on the App Store cannot have a wildcard specified within its Bundle Identifier.

When you are ready to submit your app to the App Store, you will need to create a new App ID from the Provisioning Portal and publish your app from Flash Professional using the new ID.

For example, you may have been using the Bundle Identifier com.yeahbutisitflash.* during the development of a camera app, but for distribution you will have to create a new App ID that has the wildcard removed and is guaranteed to be unique to that app. The following Bundle Identifier would suffice: com.yeahbutisitflash.camera.

It is worth noting that during development you don't have to use the wildcard within your Bundle Identifiers either, but it is useful as it allows you to quickly deploy multiple test apps to your device. If you are using an App ID that doesn't contain a wildcard, then you will be unable to deploy separate apps to your device that uses that App ID, forcing you to register a new App ID within the Provisioning Portal for each app.

Editing App IDs

The Provisioning Portal does not allow you to delete or edit any of the App IDs that you have created. Take care while naming your App IDs and assigning their Bundle Identifiers as these details cannot be changed at a later date. There is no limit to the number of App IDs you can register, so if you do make a mistake you can create and add a new one later.