Advertising Native Extension for Adobe Air This Advertising ANE add supprt to using all major mobile system and popular adverting network with Adobe Air. Supports IOS, Android and Kindle. Brought to you by the Indiegogo Campaign. Thanks to our Backers. - Michał Moczyński link
- Marcus Frasier link
- dwight.eppinger
SupportThis is an open source software. We welcome any contribution and you can send us feedback or features requests in the issues section. But we don't guarantee we can answer all your questions. Your kind donations will help us pause my daily job and put more serious effort into the development of this software for the future updates. Thanks.
If you need a dedicated support service for using this software, you can contact us at support[at]digicrafts.com.hk. We also provide software development services and you can contact us with email. Version History1.0 First public release Highlighted FeaturesThe Universal Advertising AIR native extension will include the following highlighted features: - Supporting Android/IOS/Kindle
- Supporting major advertising network
- Banner and interstitial ads
- Auto orientation
- Setting priority of each advertising network
- Backfill ads with bitmap or external images
- Simple API and minimal coding needed.
Supported Advertising NetworkThe current supporting network are list below: - Google Mobile Ads (AdMob) (ios 6.11.1/newest google play services)
- iAd (IOS only/Compile with IOS SDK 8.1)
- MillennialMedia (ios 5.4.1/android 5.3.0)
- InMobi (ios 4.5.1/android 4.5.1)
- Amazon Mobile Ads (ios 2.1.4/android 5.4.78)
- Static backfill in house ads (via external images)
- Platform supporting via AdMob Mediation Networks
Install the libraryAdd the AmazonAds-ANE library to your project. In Flash Professional CS6: - Create a new mobile project
- Choose File > PublishSettings...
- Select the wrench icon next to 'Script' for 'ActionScriptSettings'
- Select the Library Path tab.
- Click 'Browse for Native Extension(ANE) File' and select the Mopub.ane file.
In Flash Builder 4.6: - Goto Project Properties
- Select Native Extensions under Actionscript Build Path
- Choose Add ANE... and navigate to the Mopub.ane file
- Select Actionscript Build Packaging > Google Android or Apple IOS
- Select the Native Extensions tab, and click the 'Package' check box next to the extension
In Flash Professional CS5.5 or Lower: - Select File>PublishSettings>Flash>ActionScript 3.0 Settings
- Select External Library Path
- Click Browseto SWC File
- Select the Mopub.swc
In Flash Builder 4.5: - Goto Project Properties
- Select Action Script Build Path
- Select Add Swc
- Navigate to Mopub.swc and choose External Library type
In FlashDevelop: - Copy the Mopub.swc file to your project folder.
- In the explorer panel, right click the .swc and select Add to Library.
- Right-click the swc file in the explorer, choose Options, and select External Library
Add the ActionscriptImport the library
- import digicrafts.extensions.Advertising;
- import digicrafts.extensions.core.AdSettings;
- import digicrafts.extensions.data.*;
- import digicrafts.extensions.adapter.*;
- import digicrafts.extensions.events.*;
复制代码 Create a settings object. And add the adapter for different network.
- // Create a setting instance for the banner
- var settings:AdSettings= new AdSettings();
- // Manual create adapter
- // AdMob
- var adMob:AdMobAdapter=new AdMobAdapter('AD-UNIT-ID');
- // Amazon
- var amazon:AmazonAdapter=new AmazonAdapter('APP_ID');
- // iAd
- var iAd:IAdAdapter=new IAdAdapter();
- // Backfill
- // * Remember to include banner images when you packaging the app
- var backfill:BackFillAdapter=new BackFillAdapter('http://www.google.com');
- backfill.interstitial="BANNER.png";
- backfill.banner="BANNER.png";
- backfill.full_banner="FULL_BANNER.png";
- backfill.leaderboard="LEADERBOARD.png";
- backfill.medium_rectangle="MEDIUM_RECTANGLE.png";
- // Add the adapter to the settings
- settings.add(adMob,2);
- settings.add(amazon,1);
- settings.add(iAd,3);
- settings.add(backfill,4);
复制代码 If you want to load test ads, you can set the testMode property.
- Advertising.testMode=true;
复制代码 Create a banner and load. Supply an unique name and size for each banner.
- Advertising.getBanner('BANNER_1',AdSize.BANNER,settings);
复制代码 You can also show the banner immediately. Supply the position and refresh rate.
- Advertising.getBanner('BANNER_1',AdSize.BANNER,settings).show(AdPosition.BOTTOM,30);
复制代码Supported positions. - AdPosition.BOTTOM
- AdPosition.BOTTOM_LEFT
- AdPosition.BOTTOM_RIGHT
- AdPosition.TOP
- AdPosition.TOP_LEFT
- AdPosition.TOP_RIGHT
- AdPosition.CENTER
Remove the banner from screen. - Advertising.getBanner('BANNER_1').remove();
复制代码Create an interstitial and load. - Advertising.getInterstitial('INTERSTITIAL_1',AdSize.BANNER,settings);
复制代码Show the Interstitial Ad. Supply the frequency to appear. Also, you can specify the max count to show. - Advertising.getInterstitial('INTERSTITIAL_1').show(3,2);
复制代码You can listen to the event by adding a listener to the Advertising instance. - function handleAdEvent(e:AdEvent):void{
- // e.data contains the raw event data
- // e.ad contains the ad instance for the event
- }
- Advertising.getInstance().addEventListener(AdEvent.AD_LOADED, handleAdEvent );
复制代码Supported events. - AdEvent.AD_LOADED
-Event type for ad loaded. - AdEvent.AD_WILL_PRESENT
-Event type for ad will going to show on screen. - AdEvent.AD_DID_PRESENT
-Event type for ad did show on screen. - AdEvent.AD_WILL_DISMISS
-Event type for ad will remove from screen. - AdEvent.AD_DID_DISMISS
-Event type for ad did remove from screen. - AdEvent.AD_FAILED_TO_LOAD
-Event type for ad did fail to load. - AdEvent.WILL_LEAVE_APPLICATION
-Event type for ad did fail to load.
Setup for AndroidImportant Notice: Since the current AIR SDK (<15.0) use an old version build tools and it is not compatialbe with the recent Google Play Service library. It lead to a class missing exception when using AdMob adapter. To fix, copy the dx.jar from the new Android SDK to the AIR SDK. Update Your Application DescriptorYou'll need to be using the AIR 14.0 SDK or higher, include the extension in your Application Descriptor XML, and update the Android Manifest Additions with some settings.Add the following settings in tag. - <!-- Google Play -->
- <meta-data android:name="com.google.android.gms.version"
- android:value="@integer/google_play_services_version"/>
- <activity android:name="com.google.android.gms.ads.AdActivity"
- android:theme="@android:style/Theme.Translucent"
- android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
- <!-- Amazon Mobile Ads -->
- <activity android:name="com.amazon.device.ads.AdActivity"
- android:configChanges="keyboardHidden|orientation|screenSize"/>
- <!-- Millennial Media -->
- <activity android:name="com.millennialmedia.android.MMActivity"
- android:theme="@android:style/Theme.Translucent.NoTitleBar"
- android:configChanges="keyboardHidden|orientation|keyboard|screenSize" ></activity>
- <!-- InMobi -->
- <activity android:name="com.inmobi.androidsdk.IMBrowserActivity"
- android:configChanges="keyboardHidden|orientation|keyboard|smallestScreenSize|screenSize"
- android:theme="@android:style/Theme.Translucent.NoTitleBar"
- android:hardwareAccelerated="true" />
复制代码Add the following basic permissions. - <uses-permission android:name="android.permission.INTERNET"/>
- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
复制代码Add the following permission if you want video interstitial supported (millennialmedia). - <uses-permission android:name="android.permission.RECORD_AUDIO" />
- <uses-feature android:name="android.hardware.microphone" android:required="false" />
复制代码Add the following permission if you want the ad target location. - <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
复制代码 DeveloperThe software is developed by Digicrafts. http://www.facebook.com/DigicraftsComponentshttp://www.digicrafts.com.hk/componentsLicenseThis project is licensed under the BSD license link
网盘地址: http://pan.baidu.com/share/link?shareid=3045291307&uk=1761709694
相关链接:
https://github.com/digicrafts/Advertising-ANE
下载
|