AdMob - UMP

Hi everyone,

I was wondering if there are any plans to integrate the User Messaging Platform (UMP) into the AdMob native extension for Defold. This would greatly simplify managing GDPR and consent requirements.

I also noticed there’s an issue raised here: EU Consent Management Requirements for 2024 · Issue #38 · defold/extension-admob · GitHub.

Thanks in advance!

There are no immediate plans to add this, but if enough users request it then we will consider it. Also, since this is code in an extension it is something that is relatively easy for a motivated developer to add themselves.

i might be that motivated developer :smiley:

i have 0 experience with building extensions in defold, i’m reading the doc at the moment, can i ask you to review my plan of action?

i think extending your extensions is above what i am able to do, but because i am targeting android only i was thinking to build just a simple native extensions for android only which, looking at the github example should be a lot easier: https://github.com/defold/extension-android/tree/master/androidnative

am i correct in thinking that in theory i should just create an extension similar to androidnative but i should include a gradle file with the UMP library, then write up a java file that calls and uses UMP, and let surface those methods writing up an extension cpp?

That sounds about right!

nice one!

i will have a go i might bother people on this thread if i’m stuck.
but if it works, i’m happy to make the repo public as i think A LOT of people will want this very soon.

but ideally once your extension will provide this in the long term, i would 100% migrate over to remove a dependency from my clunky stuff.

1 Like


i thought i managed, but yes, i was wrong :smiley:

i have error during the build, i created a gradle file to reference the library and so far so good i was able to lunch the test app, as soon i start importing references the build blows up.

i’m unsure why because i checked other extensions and it seems you can use library you reference with gradle (and i can see the library being downloaded in the logs)

i will keep digging but seems i’m clearly missing something trivial here.

any help is much appreciated.

EDIT: solved it

1 Like

question, my UMP extension will need

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

in the manifest.

which is already in the admob extension, i want to use these 2 extensions at the same time.

what is the best way of doing this? what happens if we endup with 2 extensions adding the same thing to the manifest?

should i omit the entry in my manifest and let the admob-extension fill the gaps?

The manifests will be merged using the manifestmerger tool provided by Google:

it works in a very simple project:

i am now looking to integrate both my extension and the admob extension in my main project, wish me luck :smiley:

1 Like

i have created my extensions and a tag:

i have imported the extension in my game.project and clicked fetch libraries, but nothing happened, and i can’t see it with the other extensions
image

what am i doing wrong? i have no error messages or anything

add to game.project file:

[library]
include_dirs = umpandroidnative

Also I recommend you to remove ca-app-pub id from public repo.

that didn’t worked, also why my extension is not working like the other ones?

i mean… as you can see i’m using monarch, druid and they work just fine so i think i’m aware on how to import a depencies the problem here is that the one that i wrote is not showing up, so the problem must be in my extension rather than the way i import it.

but thanks for the help!

Error says it. Check you gui script file and remove if there is any require(“umpandroidnative”) . NE(c/c++) doesn’t need to required

i agree and i have done it.

the problem is that my extension is not showing up after i fetch the libraries.

it should be there
image

but it’s not, so when i run my code it fails saying that cannot find the stuff i’m referencing

I told you, add library to your game.project and push it to github.
There is no lib definiton on github repo:

1 Like

This is how Defold knows which folder to fetch as lib

aaaah you are 100% right!
i thought you were saying to add that folder name to the project that was going to use the dependency, you were saying to change the game.project of my extension!!

that worked! thank you so much!

i also changed the name to “ump”, umpandroidnative sounded awful!

2 Likes

:partying_face: Glad it worked!

2 Likes