Jump to content
Vanar

AdMob in Delphi11

Recommended Posts

hi

There are changes in the Androidapi.JNI.AdMob library
So the problem occurred in compatibility
I tried to solve the problem but I couldn't find any documentation for Androidapi.JNI.AdMob

  • Thanks 1

Share this post


Link to post

Dave, you are a goldmine 🙂

There appears to be several must do, should do, could do (or do not's) that would help the fledgling developer to get started in a good way, and I bet those were hard earned learning points?

I would love to see you author an article (or a book) on the ins and outs of doing an Android app with Delphi!


Thank you for all your contributions, and a Happy New Year to you!

  • Like 4

Share this post


Link to post

didnt work for me can anyone post a tutorial on how to integrate it in my projects??? please !! thank you very much

Share this post


Link to post
41 minutes ago, houssam1984 said:

didnt work for me

That's way too vague. Did you try the demo? Bear in mind (and if you read the readme) that it depends on the Kastri library.

Share this post


Link to post

is there any detailed tutorial on how to make it fully work??? on 10.4 i just add a unit to my project and call it in uses but on delphi 11 .......... hhhhh it is more complicated i guess 

Share this post


Link to post
1 hour ago, houssam1984 said:

[dcc32 Fatal Error] DW.AdMobBannerAd.pas(14): F1026 File not found: 'DW.GlobalDefines.inc'

The AdMob demo (as well as others in the Playground repo) is dependent on the Kastri library: https://github.com/DelphiWorlds/Kastri

 

Please see the Project Configuration section, here: https://github.com/DelphiWorlds/Playground/blob/main/Readme.md

Share this post


Link to post

Hi. I'm using Delphi 12. I connected Kastri-master and am testing admob.  In Object inspector  in AdmobBanerAd1.AdUnitID I connected my data ca-app-pub-328..... After compilation an error is thrown. what am I doing wrong?

Screenshot_20240527-073009.jpg

Share this post


Link to post
5 minutes ago, sevalx@gmail.com said:

what am I doing wrong?

It's literally telling you what the problem is, i.e. you need to include meta-data in the manifest. Please see this section of the readme.

Share this post


Link to post
Posted (edited)
23 hours ago, Dave Nottage said:

It's literally telling you what the problem is, i.e. you need to include meta-data in the manifest. Please see this section of the readme.

I also changed the data in the manifest... I just didn’t attach the file earlier. the error persists.

 

Edited by sevalx@gmail.com

Share this post


Link to post
9 minutes ago, sevalx@gmail.com said:

I also changed the data in the manifest... I just didn’t attach the file earlier. the error persists.

Looking at your screenshot, you have the meta-data inside of a service tag, rather than inside the application tag, as per the readme that I linked to.

Share this post


Link to post
11 minutes ago, Dave Nottage said:

Looking at your screenshot, you have the meta-data inside of a service tag, rather than inside the application tag, as per the readme that I linked to. 

Thank you for noticing my inattention. The first error is gone. Now there is an error  Consent error from : ConsentInfoUpdate-3 Publisher misconfiguration:Malformed request; the requested app ID is likely malformed, please fix it and try again. In the test application where can this be changed? to manage the request.  Or does it all change only on the admob website?

Share this post


Link to post
6 minutes ago, sevalx@gmail.com said:

ConsentInfoUpdate-3 Publisher misconfiguration:Malformed request; the requested app ID is likely malformed, please fix it and try again

I just noticed in your screenshot that you also had the name attribute of the meta-data incorrect, however given that the first error has gone, I assume you've corrected that? It should look like this:

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

i.e. the name attribute should be:  com.google.android.gms.ads.APPLICATION_ID

 

If it is now correct, the next error message suggests that the value (in the value attribute of the meta-data) you are supplying is incorrect. You should also pay attention to the details in the User Messaging Platform section of the readme.

Share this post


Link to post
On 5/28/2024 at 7:43 AM, Dave Nottage said:

If it is now correct, the next error message suggests that the value (in the value attribute of the meta-data) you are supplying is incorrect. You should also pay attention to the details in the User Messaging Platform section of the readme.

Will the values of the two parameters be the same?

<meta-data   android:value   and  AdMobBannerAd1.AdUnitAd

 

But how to use different advertisements if they have different identifiers? The reward banner has one ID and the interstitial ad has a different ID. Using the adm component we specify the application ID.

 

The error above was due to an incorrectly specified ~ prefix in the parameter. But now there's a new mistake

Consent error from: ConsentInfoUpdate - 3: Publisher misconfiguration: Failed to read publisher's account configuration; no form(s) configured for the input app ID. Verify that you have configured one or more forms for this application and try again. Received app ID: `ca-app-pub-3285XXXXXX~XXXXX"

Share this post


Link to post
2 hours ago, sevalx@gmail.com said:

Will the values of the two parameters be the same?

<meta-data   android:value   and  AdMobBannerAd1.AdUnitAd

No, since one is an application id, and the other is an ad unit id.

2 hours ago, sevalx@gmail.com said:

But how to use different advertisements if they have different identifiers? The reward banner has one ID and the interstitial ad has a different ID.

By setting the AdUnitId property of those you have ids for. You set these up in the AdMob web interface

2 hours ago, sevalx@gmail.com said:

Failed to read publisher's account configuration; no form(s) configured for the input app ID

.The most likely cause is that you need to configure GDPR and IDFA messages, here.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×