Requirements
Prerequisite knowledge
Actionscript 3.0
Required products
Adobe AIR SDK
Sample files
ANE_Resources.zip (2436 KB)
User level
Intermediate

 
Introduction

With the release of Gaming SDK couple of years back, Adobe has provided a strong platform for game developers for developing high-quality applications. All vital resources like open source frameworks, iOS native extensions(ANEs), Away Builder workflow tool, ATF tools were bundled into a single, easy-to-use package.
 
Now, with Apple mandating the submission of only 64-bit binaries to its AppStore, Adobe has gone ahead and not only added universal 64-bit support in the latest AIR SDK but has also updated all the Gaming SDK ANEs to support 64-bit packaging. These new ANEs should help  game developers in adhering to the proposed application submission guidelines from Apple.
 
The details of all the ANEs shipped with Gaming SDK are as follows:
 

 
Game Center

Game Center is a social gaming service which allows players to share information about the games they are playing and to join other players in multiplayer matches. Using Game Center native extension, an AIR based application would be able to perform Game Center related operations like authenticating a player, submitting and retrieving scores, reporting and resetting achievements, connecting and starting multiplayer matches, among others.
 
Detailed information about the API set supported by Game Center native extension can be found here.
 

 
Product Store

With most of the applications created nowadays based on the freemium model of revenue generation, developers need a mechanism to deliver premium content, subscriptions and virtual goods to their application users. Product Store native extension provides all these capabilities by using Apple’s Storekit framework to support in-app purchases within any AIR based iOS application. It provides end-to-end transaction functionalities to the developers like product registration, catalogue management, purchases, and content delivery to their users.
 
Detailed information about the Product Store APIs available to the developers is available here.
 

 
Stage Ad

Developers across the world are increasingly adopting advertisements within their applications for both revenue generation as well as cross promotion of other applications. Stage Ad native extension addresses this requirement by utilizing the capabilities of Apple’s iAds platform to display the advertisements inside applications. A developer can opt for displaying either full screen or banner ads within his application while the ads are delivered from the iAds network. The Stage Ad API set ensures that the developer can handle various stages of advertisement loading including any errors received during the process.
 
Information about the Stage Ad API’s and their usage can be found here.
 

 
Social

Today, developers want to effectively utilize the reach of social networks to enhance the application usage experience of their users. Social native extension helps them achieve that by helping the developers to incorporate major social networks like Facebook, Twitter and SinaWeibo within their application. It helps them achieve various social networking related tasks like status posts, image upload, url addition through native UIs of these social networks.
 
Detailed information about the usage of this native extension is available here.
 

 
Packaging an Adobe Native Extension

To access all the resources of the ANEs mentioned earlier, download the ANE_Resources.zip file attached with this article. The .zip file contains the following folders within each of the ANE directories:
 
  1. ActionScriptLibrary: Contains the Actionscript library project for generating the .swc file used for ANE packaging.
  2. iOSLibrary: Contains the native Xcode project for building the .a file required during ANE packaging.
  3. ReadyToUseExtension: Contains the pre-packaged ANE for using it directly within your AIR mobile project for iOS.
  4. ResourcesForPackagingANE: Contains all the assets, for example, stageAd.swc, libstageAd.a, library.swf, extension.xml, platformoptions.xml which are required for packaging an ANE yourself.
  5. Sample: Contains a sample Actionscript mobile project which demonstrates the usage of any ANEs API set.
If you want to make changes in the sources of any of the ANEs and package it yourself, you would need to follow these steps:
 
  1. Import the native project located in the iOSLibrary folder into Xcode 6.1 or higher and make the requisite modifications. Build the project to generate the corresponding .a file.
  2. Once the .a file is generated, copy it to the following directory:
    /ResourcesForPackagingANE/iPhone-ARM/
  3. Now import the Actionscript library project located in the ActionScriptLibrary folder into Flash Builder and make the corresponding changes to generate the .swc file.
  4. Once the .swc file is generated, copy it to the following directory:
    /ResourcesForPackagingANE/
  5. Now unzip this newly generated .swc file to obtain the library.swf file required for packaging the ANE, using the following command:
    unzip <ActionscriptLibrary>.swc
  6. Place the library.swf obtained in step 5 in the following directory:
    /ResourcesForPackagingANE/iPhone-ARM/
  7. Now you have all the required resources available with you to package the ANE. Navigate to the ResourcesForPackagingANE folder in respective ANE parent directory.
  8. Now to package any of the ANEs, run the following command:
    <AIR_SDK>/bin/adt -package -target ane <ANE_Name>.ane extension.xml -swc <AS3_LibraryName>.swc -platform iPhone-ARM -platformoptions platformoptions.xml -C iPhone-ARM/ library.swf <iOSLibrary>.a

    For example to package the  StageAd ANE, you would need to run the following command:

    <AIR_SDK>/bin/adt -package -target ane stageAd.ane extension.xml -swc stageAd.swc -platform iPhone-ARM -platformoptions platformoptions.xml -C iPhone-ARM/ library.swf libstageAd.a
 
 
Once done, you would have successfully packaged the stageAd.ane file, which you could use in any of your AIR based iOS mobile project.