Extension-admob

Thanks for all your best works. It seems the extension will work well for both Android and iOS.
And just my opinion, someone could improve the iAp extension. For my last try, it did not work at all with newest Android library. Donation can be made from other devs.:grin:

Iā€™ve tested extension on Android with the latest Google Play Services 49 (ie Mobile Ad SDK 20.6.0) and Android SDK 31.
Both debug and release versions show ads fine for me, Iā€™ve tried interstitial only.
Android now requires to have new permission <uses-permission android:name="com.google.android.gms.permission.AD_ID"/>, I will update github version soon.

I see some warnings about depreciated methods in the extension, but not sure how to check what these methods are.
Does anyone know?

I will check iOS version of the extension next.

1 Like

Extension works fine for iOS as well with the latest Mobile Ads SDK 9.4.0, just required some minor updates.
The only problem, I had the same error with initWithAdSize:GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth as @Greg209, looks like itā€™s SDK bug. So, I have commented it out for now, ie. Adaptive Banner is not going to work, other sizes should be fine, letā€™s hope they will fix it soon.

I will update github version next week.

1 Like

Hi @pozirk.

Just tried the latest from GitHub and apart from a couple of things Iā€™ve now managed to get the test adverts working on both Android and iOS. Thanks for the update. One thing I did differently was to setup the repo using haxelib dev <path to folder> and building manually rather than using the buildPackages.sh and installPackages.sh.

The couple of things are :

  1. In the repo, the folder ā€˜frameworksā€™ has a typo in it - ā€˜framworksā€™ without the ā€˜eā€™.
  2. I wanted to test on an iOS device and had to modify the AdmobEx.mm Ln #387 to specify an explicit device ID for testing, as it didnā€™t work trying to establish the ID in code. The ID I used came from the console output when I tried the build originally.

Thanks again.

Yep, Iā€™ve fixed framworks.
buildPackages.sh and installPackages.sh are from original haxe extension, Iā€™ve never used them myself. :slight_smile:
Was something confusing about test ads for iOS, but regular ads worked fine for me, so I didnā€™t test that.
Itā€™s different for Android, for debug build, you need test ads for them to work.

Big update v2.2.0
Iā€™ve added GDPR support for EEA and UK as it will be soon required by Admob.
New version is available on Github only, I would like to test it a bit more before pushing to haxelib.

Anyone from EEA or UK willing to test? :slight_smile:

3 Likes

Hi Pozirk,
Thank you for your hard work on upgrading the extension-admob.
I have a couple of questions about the new extention.

1.) The old extension had a function called tagForChildDirectedTreatment().
It was used to tell admob to show only child friendly ads. Is there something similar in the upgrade?

2.) Should I use Admob.loadInterstitial(INTERSTITIAL_ID); every time I want to show an interstitial. Or should I just load it once when the game starts and then just use Admob.showInterstitial() each time I want to show an ad.

3.) The old showInterstitial() had some params to limit how often that ad is shown.
- To avoid displaying the interstitial if the game was too short (60 seconds), call: AdMob.showInterstitial(60);
Does the upgrade have the same?

I did not upgrade the games for 4+ years. So I am sorry if some of the questions are too ignorant of current admob requirements.

Hey,

  1. Yes, second parameter for init() function is childDirected, set it to true to enable only children friendly ads. I have never tested it though.

  2. You need to call loadInterstitial each time you want to load a new ad.
    Admob has frequency cap in the settings of your ad unit, where you can setup how often you want it to be shown. Or you can have your own timer. I didnā€™t implement this functionality in the extension.

1 Like

Thank you very much for promt replies.

Does the extension-admob use Advertising ID required by Play Store?

Yes, also check this: