I'm making this guide for you who've been wanting to publish your game while using AdMob, I'll not release yet my tool for calling admobs inside your .lua file, but this will give you an overview that tutorials made by google won't work when doing this distribution:
So, the first problem you will find when adapting the admob sdk for LOVE, is some strange error that when including this into your build.gradle ->
Code: Select all
implementation 'com.google.android.gms:play-services-ads:19.2.0'
Admob Lite SDK
But that is quite okay, it still works, you can integrate as the main doc from admob.
When integrating new things into your LOVE Android project, there are 2 AndroidManifest.xml that you need to mantain, one stands for the normal assemble and playstore,located on app/src/main the other last is the embed, /app/src/embed(which will probably be the one you will be testing while using Android Studio)
While integrating, there are 2 things that you need to copy over every manifest:
Below <manifest> declaration, include ->
Code: Select all
<uses-permission android:name="android.permission.INTERNET"/>
And the other is below <application> tag:
Code: Select all
<meta-data
android:name="com.google.android.gms.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713"/>
you need to include below your game <activity> tag:
Code: Select all
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent" />
Code: Select all
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
Without this, my embed build refused to show the Ad, this is undocumented on the main documentation,
For the normal/playstore build, include the following code in their manifests:
Code: Select all
<meta-data
android:name="com.google.android.gms.ads.AD_MANAGER_APP"
android:value="true"/>