nboy1 / admob-for-flash-android-GMA-21.0.0

this is admob for flash android ANE and it is a personnel update to " lilili87222 / admob-for-flash ANE"
2 stars 0 forks source link

Ads don't display #1

Open sairope opened 2 years ago

sairope commented 2 years ago

I've updated my code from the original ANE, and now I have the following in my Class:

var extraParam=new ExtraParameter();
extraParam.testDeviceID="false";
extraParam.nonPersonalizedAds=true;

if (Admob.getInstance().supportDevice){

Admob.getInstance().initAdmobSDK(extraParam);
Admob.getInstance().showBanner(bannerID,AdmobSize.SMART_BANNER,AdmobPosition.TOP_CENTER,0,extraParam);
Admob.getInstance().cacheInterstitial(fullID,extraParam);

}

I've added the necessary permisions to the descriptor file inlcluding:

I get no errors, but I don't see any ads with this new GMA 21 ane. Ads display just fine in the old ane. So what am I doing wrong?

nboy1 commented 2 years ago

I've updated my code from the original ANE, and now I have the following in my Class:

var extraParam=new ExtraParameter();
extraParam.testDeviceID="false";
extraParam.nonPersonalizedAds=true;

if (Admob.getInstance().supportDevice){

Admob.getInstance().initAdmobSDK(extraParam);
Admob.getInstance().showBanner(bannerID,AdmobSize.SMART_BANNER,AdmobPosition.TOP_CENTER,0,extraParam);
Admob.getInstance().cacheInterstitial(fullID,extraParam);

}

I've added the necessary permisions to the descriptor file inlcluding:

I get no errors, but I don't see any ads with this new GMA 21 ane. Ads display just fine in the old ane. So what am I doing wrong?

this is the code i use with admob test ID's you can change it to your real ID's when you want to publish it. it's working fine. in your code i didn't see where you show the interstitial. ( if(Admob.getInstance().isInterstitialReady()) { Admob.getInstance().showInterstitial(); } ), you will not see interstitial this way you need to call showInterstitial(); this is my code i use.

///////////////////////////////////////////////////////////////////////////////////////////////////////////

import so.cuo.platform.admob.Admob; import so.cuo.platform.admob.AdmobPosition; import so.cuo.platform.admob.AdmobSize; import so.cuo.platform.admob.ExtraParameter;

  private var admob:Admob;
  public var extraParam:ExtraParameter;

Admob.getInstance().initAdmobSDK(new ExtraParameter()); this.extraParam = new ExtraParameter();

     Admob.getInstance().cacheInterstitial("ca-app-pub-3940256099942544/1033173712");

     Admob.getInstance().showBanner("ca-app-pub-3940256099942544/6300978111",AdmobSize.SMART_BANNER,AdmobPosition.BOTTOM_CENTER);

     if(Admob.getInstance().isInterstitialReady())
     {
        Admob.getInstance().showInterstitial();
     }

     Admob.getInstance().cacheInterstitial("ca-app-pub-3940256099942544/1033173712");

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

nboy1 commented 2 years ago

bannerID

you need to declare this var and give it the string value of the id, or just use the ID directly "ca-app-pub-...." .

sairope commented 2 years ago

Thanks, I've managed to get the ads to display, but there's definitely an issue when it comes to ExtraParameter. If I define it and then try to procide it into showBanner, ad doesn't get displayed.

extraParam=new ExtraParameter(); extraParam.testDeviceID="true"; extraParam.nonPersonalizedAds=true;

//This code results in no ad getting displayed. 'bannerID' is a string variable with my banner ID. Admob.getInstance().showBanner(bannerID,AdmobSize.SMART_BANNER,AdmobPosition.TOP_CENTER,0,extraParam);

//With the removal of two last parameters, banner gets displayed. Do ExtraParameter properties apply here also, or does it have to be done as presented above. Admob.getInstance().showBanner(bannerID,AdmobSize.SMART_BANNER,AdmobPosition.TOP_CENTER);

Is it a bug, or am I doing someting wrong? I need to be able to define ExtraParameter to make sure my ads meet Google requirements, e. g. when user opts for nonpersonalized ads.

nboy1 commented 2 years ago

i don't remember i touched something about ExtraParameter in project but i will see the old classes in old project to see if i've changed something, i never used ExtraParameters in my apps. i will see.

nboy1 commented 2 years ago

@sairope yes you are right thanks, i had a bug there, i resolve it; now everything is working fine. you can use the updated ANE now.

timxie-88 commented 1 year ago

where is ios ane? any one ?

nboy1 commented 1 year ago

where is ios ane? any one ?

i hope lilili87222 update the ios one, i don't own a mac.

nboy1 commented 1 year ago

where is ios ane? any one ?

this is a new ios and android admob ane if you're still interested https://github.com/nboy1/Admob-for-Flash-ANE-GMA21-GLM-