Developer Console
Gracias por tu visita. Esta página solo está disponible en inglés.

Add a Plugin to Your Adobe Air Project

If you are using the In-App Purchasing (IAP) v2.0 Adobe AIR plugin, you should follow the instructions for adding the IAP v2.0 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 IAP v2.0 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.

Add the IAP v2.0 plugin to your project

To add the In-App Purchasing (IAP) v2.0 plugin to your Abode AIR project, import the API package:

import com.amazon.device.iap.cpt.*;

Update the Adobe AIR application descriptor

If you are deploying your Adobe AIR app to Android and use the In-App Purchasing (IAP) v2.0 plugin, you must update the Adobe AIR application descriptor before packaging your code.

  1. First, modify your application's application descriptor to include the extension. Add the following as a child to your application descriptor's <application> element:
        <extensions>
            <extensionID>com.amazon.device.iap.cpt.AmazonIapV2Extension</extensionID>
        </extensions>
    
  2. 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 <application> element:
        <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>
    

Build 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:

  1. Compile your app into an SWF file. You can use the following amxmlc command 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>
    
  2. Create or obtain a certificate to use to sign the app. For iOS, you must obtain the certificate from Apple using your Apple developer account. For Android, you can create the certificate using the following adt command:

    adt -certificate -validityPeriod 25 -cn SelfSigned 1024-RSA certificate.pfx "password"
    
  3. Package your app.

    • Package the app as an APK for Android

      Use adt to 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.

      Use adt to 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>
      

Last updated: Jan 15, 2022