App ID Question...

In the following code sample for the build.settings on Android:

` ` `applicationChildElements =`

`        ` `{`

`            ` `[[`

`                ` `<meta-data android:name=` `"com.google.android.gms.ads.APPLICATION_ID"`

`                    ` `android:value=` `"[YOUR_ADMOB_APP_ID]"` `/>  ` `-- replace with your app id. See: https://goo.gl/fQ2neu`

`            ` `]],`

`        ` `},`

is the part “[YOUR_ADMOB_APP_ID]” resulting in entering “ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy” or is it “[ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy]” ?

with the [] brackets or without?

One more thing… is there a typo in the documentation with " `` />" ?


Shouldn’t the line android:value= "[YOUR_ADMOB_APP_ID]" />
end with " instead of the /> ?
I guess it should be: android:value=“ca-app-pub-xxxxx-yyyyy”/> , right?

You don’t include the square brackets in your entry, those are just to show where the content to be replaced starts and ends. My entry looks like this (obviously I’ve changed the numbers):

applicationChildElements =
{
    [[
        <meta-data
                  android:name="com.google.android.gms.ads.APPLICATION_ID"
                  android:value="ca-app-pub-1111111111111111~0000000000"/>
    ]],
},

Thanks for the clarification. One more question:
After adding the code lines to the build.settings, do I have to do something else to make this work? Init it somehow or something?

That depends. Are you just using Admob by itself, or as part of a mediation SDK like ironSource or Appodeal?

If you are using it with a mediation plugin then I don’t think you need to do anything more for Admob itself.

If you are using the Admob plugin directly, you need to require the plugin, initialise it and then call load/show etc as needed:

local admob = require( "plugin.admob" )
 
-- AdMob listener function
local function adListener( event )
 
    if ( event.phase == "init" ) then  -- Successful initialization
        print( event.provider )
    end
end
 
-- Initialize the AdMob plugin
admob.init( adListener, { appId="YOUR_ADMOB_APP_ID" } )

Okay, so when using admob like “before” this still is the same it seems. I was using admob directly but some time ago this new lines in the build.settings were not required. So I guess everything should work fine by just adding the new lines to the build settings because with the code you have shown, this still is unchanged to the code I had.