Kastri icon indicating copy to clipboard operation
Kastri copied to clipboard

[Admob] Error InterstitialAd

Open zyxel4754 opened this issue 3 years ago • 4 comments

I have tested Kastri's "Admob" demo. Adding in the code

`...

FIntAd := TInterstitialAd.Create; FIntAd.AdUnitId:='ca-app-pub-xxxxxxxxxxx'; FIntAd.TestMode := false; ... Also I've also added the dw-admob.jar file to the Libraries and changed the AndroidManifest.template.xml file by adding... <%application-meta-data%> android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-xxxxxxxxxxxxxxxxxxxxxxxxx"/> <%uses-libraries%> ... ` I compile it without problems and when I press the [Interstitial] button I get the following error:

Ad Failed to Load (tInterstitialAd) 3: No ad config

I Using: Delphi 11 Version 28.0.45591.0253 Update 1 Platform: Android 9 Model: Xiaomi Mi A1

zyxel4754 avatar Aug 08 '22 10:08 zyxel4754

Assuming you actually added the correct xml (your example is wrong, but it won't compile if it looks like that), if you've only just set up your AdMob it can take a while before the ad unit becomes "active". Please try again in a few hours.

DelphiWorlds avatar Aug 08 '22 11:08 DelphiWorlds

I copied the code snippet from the Delphi template, after compiling it looks like this:

    <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID"
        android:value="ca-app-pub-xxxxxxxxxxxxxx"/>

Everything I said yesterday I have tested it on a device with Android 12 and it works perfectly and you can see the Interstitial in full screen, however today I have tested it again on an Android 9 and it doesn't work, it still gives the error: Ad Failed to Load (tInterstitialAd) 3: No ad config

zyxel4754 avatar Aug 09 '22 20:08 zyxel4754

Not sure what is happening with your Android 9 device - I just tried the demo on the Android 9 device I have and it is working OK.

DelphiWorlds avatar Aug 09 '22 21:08 DelphiWorlds

Ok, so I'll check my Android 9 device and see if I can find out what's going wrong.

zyxel4754 avatar Aug 10 '22 07:08 zyxel4754