Admob ANE is a native extension that allows the use of Google’s Admob advertisements on Android or iOS. The developer has control to choose the ad size, its position and the moment when it should be displayed. The extension has a single API for Android and iOS.
The extension provides a set of ad event, such as when an ad was received by the device. The extension also has some helper methods, allowing the developer to read the ad size, the screen size or the device MAC address.
Sample
var admob:Admob=Admob.getInstance(); admob.setKeys("a152834c8723912"); // simple banner usage admob.showBanner(Admob.BANNER,AdmobPosition.BOTTOM_CENTER); // interstitial ad (full screen ad) if (admob.isInterstitialReady()) { admob.showInterstitial(); } else { admob.cacheInterstitial(); } admob.addEventListener(AdmobEvent.onBannerReceive,onAdReceived); protected function onAdReceived(event:AdmobEvent):void { if(event.type==AdmobEvent.onBannerReceive){ trace(event.data.width,event.data.height); } }
RT @as3gamegears: New: Admob ANE (native extension to use Google’s Admob advertisements) http://t.co/wjrXd6QrPa #as3 #flash #gamedev
admob publisher ID is 17 digits in your sample but i receive a 15 digits ID from google. No matter what I enter as my publisher ID i always receive this message instead of banner “you must have adactivity declared in androidmanifest.xml with configchangesâ€.
I tried adding few lines of code to my androidmanifest.xml that i got from google but nothing changed. I still receive this message. Any thought?
project has update to
http://code.google.com/p/flash-air-admob-ane-for-ios-and-android/
the old link is invailable now
Thanks for letting me know! I’ve updated the links and the code sample.
How do you dispose of the banner ad?
You can call the
hideBanner()
method. Download the full documentation here.