Add a Plugin to Your Adobe Air Project
If you are using the In-App Purchasing v2 Adobe AIR plugin, you should follow the instructions for adding the In-App Purchasing plugin to your Adobe AIR project. Additionally, if you are deploying to Android, you should follow the instructions for updating the Adobe AIR application descriptor for use with the In-App Purchasing v2 plugin.
If you are using the Mobile Ads Adobe AIR plugin, you should follow the instructions for adding the Mobile Ads plugin to your Adobe AIR project. Additionally, if you are deploying to Android, you should follow the instructions for updating the Adobe AIR application descriptor for use with the Mobile Ads plugin.
Adding the In-App Purchasing v2 Plugin to Your Adobe AIR Project
When writing the code for your project, import the API package:
Updating the Adobe AIR Application Descriptor for Use with the In-App Purchasing v2 Plugin
If you are deploying your Adobe AIR app to Android and have made use of the IAP v2 plugin, you need to update the Adobe AIR application descriptor before packaging your code.
- First, modify your application's application descriptor to include the extension. Add the following as a child to your application descriptor's
<extensions> <extensionID>com.amazon.device.iap.cpt.AmazonIapV2Extension</extensionID> </extensions>
- Second, if you are deploying to Android, you need to declare the IAP response receiver in the Android manifest. Add the following code as a child of your application descriptor's
<android> <manifestAdditions> <![CDATA[ <manifest> <application> <receiver android:name = "com.amazon.device.iap.ResponseReceiver" android:permission = "com.amazon.inapp.purchasing.Permission.NOTIFY" > <intent-filter> <action android:name = "com.amazon.inapp.purchasing.NOTIFY" /> </intent-filter> </receiver> </application> </manifest> ]]> </manifestAdditions> </android>
Building an Adobe AIR App (for all plugins)
Adobe AIR and certain other development tools are provided by third parties, not by Amazon. Our links for these tools take you to third-party sites for downloading and installing the tools.
To build an Adobe AIR app that uses the Amazon IAP plugin, you need the tools that come with the AIR and Flex SDKs. The tools are available at http://flex.apache.org/installer.html. There is also more information available in the Adobe AIR documentation at Using native extensions for Adobe AIR and Packaging with ADT.
Once you have the necessary tools, follow these instructions to build your app:
Compile your app into an SWF file. You can use the following
amxmlccommand to compile your app into an SWF file:
amxmlc <path to application source file> -compiler.include-libraries=<path to ANE file> -swf-version=13 -output <path to output SWF file>
Create or obtain a certificate to use to sign the app. For iOS, you need to obtain the certificate from Apple using your Apple developer account. For Android, you can create the certificate using the following
adt -certificate -validityPeriod 25 -cn SelfSigned 1024-RSA certificate.pfx "password"
Package your app.
Package the app as an APK for Android
adtto create the APK file. For example:
adt -package -target apk-captive-runtime -storetype pkcs12 -keystore certificate.pfx -storepass password output.apk <path to application descriptor file> <path to SWF file> -extdir <path to the directory containing the ANE file>
Package the app as an IPA for iOS
You will need the certificate and provisioning profile file, as well as the necessary icons.
adtto create the IPA file. For example:
adt -package -target ipa-debug -keystore ios-developer-certificate.p12 -storepass password -storetype pkcs12 -provisioning-profile ios.mobileprovision output.ipa <path to application descriptor file> <path to SWF file> <directory containing icons> <path to default splash screen image> -extdir <path to the directory containing the ANE file>