Reputation: 223
I am creating a flash game in Actionscript 3 and Flash CC. I intend to publish the game for iOs and Android.
I am looking for a way to show AdMob ads in Actionscript.
So far I have done those steps but no ads appear anywhere on screen:
I use the code below when the game is starting, before anything else:
import so.cuo.platform.admob.Admob;
import so.cuo.platform.admob.AdmobPosition;
import so.cuo.platform.admob.AdmobEvent;
import so.cuo.platform.admob.AdmobSize;
var admob:Admob= Admob.getInstance();
if(admob.supportDevice){
admob.setKeys("9141023615", "6222882810");//changed my keys with random ones
admob.addEventListener(AdmobEvent.onInterstitialReceive,onAdReceived);
admob.addEventListener(AdmobEvent.onBannerReceive,onAdReceived);
admob.cacheInterstitial();
admob.enableTrace=true;
}
function onAdReceived(event:AdmobEvent):void
{
if(event.type==AdmobEvent.onBannerReceive){
admob.showBanner(Admob.BANNER,AdmobPosition.TOP_CENTER);
}
if(event.type==AdmobEvent.onInterstitialReceive){
admob.showInterstitial();
}
}
I have tried both banner and interstitial ads and none of them show up. I downloaded the app on my iPad and checked that it passes the if(admob.supportDevice)
stage by showing a dynamic text field on screen.
My questions are:
/
for each application (ca-app-pub-XXXXXXXXXXXXXXXX/XXXXXXXXXX
).I have not used AdMob in any other language so I am not too experienced with it.
Upvotes: 3
Views: 1191
Reputation: 106
follow the doc https://code.google.com/p/flash-air-admob-ane-for-ios-and-android/
your Admob ID format is error,must be format
ca-app-pub-XXXXXXXXXXXXXXXX/XXXXXXXXXX
not part after /
Upvotes: 1
Reputation: 31
I did have exactly the same problem with "so.cuo.platform.admob.Admob"
And i waste a lot of time to make it work.
When i manage to integrate it the app was refused since the library is obsolete.
I then found this other ANE extension which seems a lot more complete:
- https://github.com/lancelot1/ane-admob
This did work at first try also in Flash CC, and the app did pass the approval.
The ad in the app are now working flawless!
Strongly suggested if you still have issue, or if you wish to switch on a more advance extension.
Upvotes: 2