Adobe AIR Quick Start - Enhance
Prerequisites
- Download our library using the button above
- Include the extension by following our Setup guide
Preparing your project
Enhance will integrate and update SDK code so you don't have to. In order to ensure that we don't have any conflicts, be sure to remove any existing third party services from your app that you will be using Enhance for.
If you'd like to implement ad networks using Enhance, be sure to remove all other ad networks from your app. Enhance will put them back in and make it very easy to keep them updated or to change them in the future if needed.
How Enhance Works
From a technical standpoint, the Enhance connector library will abstract the calls to third party services within your app so that we can replace those calls with the real services later on.
This means that you don't need to decide on which services you will be using before you get started. Just drop in the calls to tell us when to show an ad, how to reward users, when to log analytics events, etc. and Enhance will hook these all up to the service SDKs when you're done.
Testing and Development process
Because the actual third party service SDKs are not added until your app is run through Enhance, the library provides some functionality to help with debugging and testing while on your device.
When testing in the Adobe AIR simulator, you'll see a debug log traced to the console which will let you know that things have been integrated successfully.
After building your APK or IPA, you'll see a system dialog which can help with testing. After you run your app through Enhance, these system dialogs will be replaced with the actual ad services that you select.
Quick Start: Integrating Services
Interstitial Ads Full documentation
When you want to display an interstitial ad, simply call Enhance.showInterstitialAd();
.
You can check whether an ad is cached and ready to be displayed by calling
Enhance.isInterstitialReady();
. You can pass in a placement ID as the first argument
in each of these methods.
if (Enhance.isInterstitialReady("main_menu")) { // The "main menu" ad is ready, show it Enhance.showInterstitialAd("main_menu"); }
Read the full documentation on Interstitial Ads for more information.
Rewarded Video Full documentation
Rewarded Video ads require some callbacks to be set up so you can handle granting rewards to the user. The following example shows a simple rewarded ad implementation:
private function showAd():void { if(Enhance.isRewardedAdReady("level_complete")) { Enhance.showRewardedAd(onRewardGranted, onRewardDeclined, onRewardUnavailable, "level_complete"); } } private function onRewardGranted(type:String, value:int):void { trace("Grant reward to user here!"); } private function onRewardDeclined():void { trace("User declined to view the rewarded ad"); } private function onRewardUnavailable():void { trace("No reward was available"); }
Read the full documentation on Rewarded Ads for more information.