Godot's AdMob Plugin for Android (3.2.2+) using GitHub Actions for CI/CD. Working on Standard and Mono Godot versions.

Last update: Aug 1, 2022


GodotAdMob
Godot AdMob Android

A Godot's plugin for Android of AdMob.

AboutInstallationDocsDownloads

About

This repository is for a Godot Engine Plugin that allows showing the ads offered by AdMob in an easy way, without worrying about the building or version, just download and use.

The purpose of this plugin is to always keep up to date with Godot, supporting ALMOST ALL versions from 3.x to 4.x (when it is released), and also make the code compatible on Android and iOS, so each advertisement will work identically on both systems.

Preview

(Preview)

Features

Ad Formats Available 🤖
Banner ✔️
Interstitial ✔️
Rewarded ✔️
Rewarded Interstitial ✔️
Native is REMOVED
Others Available 🤖
EU consent ✔️
Targeting ✔️
Mediation
CI/CD ✔️

Installation

Android (v3.2.2+):

  • Tutorial: https://youtu.be/MW4hUR0d9lc
  • Download the android-?-template-v{{ your_godot_version }}.zip in the releases tab, we recommend you to use always the latest.
  • Enable Android Build Template. Check the tutorial here
  • Extract the content in android-?-template-v{{ your_godot_version }}.zip into res://android/plugins directory on your Godot project
  • Add your AdMob App ID to your app's res://android/build/AndroidManifest.xml file by adding a <meta-data> tag with name com.google.android.gms.ads.APPLICATION_ID, as shown below.
<!-- Sample AdMob app ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
	tools:replace="android:value"
	android:name="com.google.android.gms.ads.APPLICATION_ID"
	android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>
<meta-data
	android:name="com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT"
	android:value="true"/>
  • Export the project enabling the Use Custom Build and AdMob Plugin:
  • Export Project

iOS (v3.3+):

User Messaging Platform (UMP):

  • To use UMP due of EUROPE ePrivacy Directive and the General Data Protection Regulation (GDPR), you first need to do configure your Funding Choices.
  • If your app is "ForChildDirectedTreatment" then the UMP won't appear and signals won't work for consent, this is normal so don't worry.
  • To show personalized or non-personalized ads, then you need to change inside your AdMob Account npa-image

Documentation

For a complete documentation of this Plugin, check our wiki.

Alternatively, you can check the docs of AdMob itself of Android and iOS.

Contribute

We are a dedicated area to how contribute for Android and iOS on our wiki.

Getting help

DISCUSSIONS

GitHub

https://github.com/Poing-Studios/Godot-AdMob-Android-iOS
Comments
  • 1. [PRIORITY] New iOS Plugin for 3.2.4/4.0

    Soon Godot will receive the new Plugin System as Android: https://github.com/godotengine/godot/pull/41230 https://github.com/godotengine/godot/pull/41340

    The goal of this repository is being updated with the newest version of Godot, and this new Plugin System for iOS is very welcomed because will be more easy to develop for iOS.

    Tutorial: ?

    Reviewed by gumaciel at 2020-12-18 02:20
  • 2. [BUG] Crashing on iOS Godot 3.2.2

    I tested the plugin on iOS in my iPhone 8 Plus with Godot 3.2.3 and the 3.2.3 template and is working, but Godot 3.2.3 has a huge bug with buttons delay and my game is unplayable

    So tried exporting my game with Godot 3.2.2 and works perfectly, but adding the plugin with the 3.2.2 template it is crashing with the next log.

    2021-01-17 16:47:42.033876-0300 frichen[501:26981] Godot Engine v3.2.2.stable.custom_build - https://godotengine.org
    2021-01-17 16:47:42.034215-0300 frichen[501:27193]  - <Google>[I-ACS025031] AdMob App ID changed. Original, new: (nil), ca-app-pub-9081047336041164~6080891688
    2021-01-17 16:47:42.034855-0300 frichen[501:27199]  - <Google>[I-ACS023007] Analytics v.70100000 started
    2021-01-17 16:47:42.035029-0300 frichen[501:27199]  - <Google>[I-ACS023008] To enable debug logging set the following application argument: -APMAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
    2021-01-17 16:47:42.041920-0300 frichen[501:27194]  - <Google>[I-ACS023171] Resetting App Measurement data
    2021-01-17 16:47:42.043417-0300 frichen[501:26981] OpenGL ES 3.0 Renderer: Apple A11 GPU
    2021-01-17 16:47:42.045867-0300 frichen[501:26981] fopen failed for data file: errno = 2 (No such file or directory)
    2021-01-17 16:47:42.045929-0300 frichen[501:26981] Errors found! Invalidating cache...
    2021-01-17 16:47:42.054845-0300 frichen[501:27195]  - <Google>[I-ACS023014] Failed to delete old database file. Error: Error Domain=NSCocoaErrorDomain Code=4 "“google-app-measurement.sql” couldn’t be removed." UserInfo={NSUserStringVariant=(
        Remove
    ), NSFilePath=/var/mobile/Containers/Data/Application/ECD1206A-2FE3-4B36-94E8-8B91A28C0551/Library/Application Support/Google/Measurement/google-app-measurement.sql, NSUnderlyingError=0x282394b10 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
    2021-01-17 16:47:42.580870-0300 frichen[501:26981] 
    2021-01-17 16:47:42.701920-0300 frichen[501:27195]  - <Google>[I-ACS800023] No pending snapshot to activate. SDK name: app_measurement
    2021-01-17 16:47:42.818680-0300 frichen[501:27198]  - <Google>[I-ACS023012] Analytics collection enabled
    2021-01-17 16:47:42.870302-0300 frichen[501:26981] fopen failed for data file: errno = 2 (No such file or directory)
    2021-01-17 16:47:42.870404-0300 frichen[501:26981] Errors found! Invalidating cache...
    2021-01-17 16:47:42.875134-0300 frichen[501:26981] fopen failed for data file: errno = 2 (No such file or directory)
    2021-01-17 16:47:42.875183-0300 frichen[501:26981] Errors found! Invalidating cache...
    2021-01-17 16:47:43.131771-0300 frichen[501:26981] -[__NSCFString containsObject:]: unrecognized selector sent to instance 0x2838d4400
    2021-01-17 16:47:43.142919-0300 frichen[501:26981] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString containsObject:]: unrecognized selector sent to instance 0x2838d4400'
    *** First throw call stack:
    (0x1970029d8 0x1ab36bb54 0x196f12bbc 0x19700501c 0x197006f8c 0x102e6afd8 0x102e6d5dc 0x105251528 0x105252e6c 0x102e6bfd0 0x10302b558 0x103e9798c 0x103133b70 0x19a1388e4 0x19a20ae04 0x196f5fb54 0x196f83420 0x196f82834 0x196f7c9f4 0x196f7bba0 0x1adcb9598 0x19986b3d8 0x199870958 0x102ffde80)
    libc++abi.dylib: terminating with uncaught exception of type NSException
    *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString containsObject:]: unrecognized selector sent to instance 0x2838d4400'
    terminating with uncaught exception of type NSException
    (lldb) 
    
    Reviewed by martinpelli at 2021-01-17 19:51
  • 3. [BUG] Error compiling Godot for iOS with module for version 3.2.4 beta 5

    Describe the bug I'm trying to compile godot using Godot-AdMob-Android-iOS as a module, but I'm getting forward declaration errors in the iOS source:

    Screen Shot 2021-01-11 at 10 03 26 PM

    To Reproduce Steps to reproduce the behavior:

    1. Place ios/admob contents into godot/modules/admob
    2. Place google *.framework directories into godot/modules/admob/lib
    3. Run scons p=iphone target=debug

    Expected behavior Builds an ios *.a file

    Screenshots If applicable, add screenshots to help explain your problem.

    Smartphone (please complete the following information):

    • Latest Godot-AdMob-Android-iOS as of this writing
    • Latest godot from git
    Reviewed by sjhennion at 2021-01-12 03:40
  • 4. [BUG]Rewarded Ads not Loading on iOS

    Describe the bug Test ads not displaying when user selects "Ask App Not To Track" on iOS 14 devices.

    To Reproduce When promoted to allow for tracking, if the user selects the do not track button then rewarded ads do not load.

    Expected behavior The ad does not buffer and the _on_MobileAds_rewarded_ad_failed_to_load signal does not get emitted IMG_0184

    Screenshots If applicable, add screenshots to help explain your problem. Console Output

    2021-06-21 08:29:09.989764-0400 Captain Skyrunner[372:9702] Calling load_rewarded

    2021-06-21 08:29:09.989932-0400 Captain Skyrunner[372:9702] rewarded will load with the id

    2021-06-21 08:29:09.989984-0400 Captain Skyrunner[372:9702] [My Admob App ID was output here]

    2021-06-21 08:29:09.994954-0400 Captain Skyrunner[372:9702] <Google> To get test ads on this device, set: GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = @[ @"e484e6d6f7ca8ecd79bb89626c9b8dff" ];

    2021-06-21 08:29:09.995798-0400 Captain Skyrunner[372:9702] <Google> Note that test device identifiers may be reset when uninstalling and reinstalling the application.

    2021-06-21 08:29:10.052532-0400 Captain Skyrunner[372:10127] [connection] nw_endpoint_handler_set_adaptive_read_handler [C3.1.1 172.217.1.14:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for read_timeout failed

    2021-06-21 08:29:10.052604-0400 Captain Skyrunner[372:10127] [connection] nw_endpoint_handler_set_adaptive_write_handler [C3.1.1 172.217.1.14:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for write_timeout failed

    2021-06-21 08:29:10.156482-0400 Captain Skyrunner[372:9906] [connection] nw_endpoint_handler_set_adaptive_read_handler [C4.1.1 172.217.164.194:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for read_timeout failed

    2021-06-21 08:29:10.156530-0400 Captain Skyrunner[372:9906] [connection] nw_endpoint_handler_set_adaptive_write_handler [C4.1.1 172.217.164.194:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for write_timeout failed

    2021-06-21 08:29:10.368262-0400 Captain Skyrunner[372:9702] Rewarded ad failed to load with error: Request Error: No ad to show.

    2021-06-21 08:29:10.368406-0400 Captain Skyrunner[372:9702] error while creating reward

    Smartphone (please complete the following information):

    • Device: iPhone SE 2nd generation
    • OS: iOS 14.6

    Additional context

    Reviewed by Tekuzo at 2021-06-21 13:02
  • 5. [BUG] Godot 3.3 export in android

    Hi, Describe the bug _admob_singleton is found but get signal initialization_complete status NOT_READY [0]. so, not load_interstitial my ad 👎🏻

    To Reproduce Steps to reproduce the behavior: https://github.com/Poing-Studios/Godot-AdMob-Android-iOS#android-v322

    also same issues in example :: https://github.com/Poing-Studios/Godot-AdMob-Android-iOS/tree/master/example

    how can i figure out!!

    Reviewed by ATOshailesh at 2021-05-24 10:18
  • 6. [BUG] Confusion when building for iOS/How AdMob works on iOS

    Describe the bug I've ran into some issues when trying to build for iOS. This section is confusing me

    Copy the library libgodot.iphone.release.fat.a you have downloaded from releases tab inside the exported Xcode project. You must override the '.a' file with "your_project_name", should be like: 'your_project_name.a'.

    I'm not sure what it means. I took it to mean I had to copy libgodot.iphone.release.fat.a into the project, and then rename it the name of my project, but that didn't work, and then I realized there was already a my_project_name.a in the project.

    If I don't copy libgodot.iphone.release.fat.a into my project, it builds and runs (although it doesn't currently work), but if I add libgodot.iphone.release.fat.a I get compiler errors about duplicate symbols.

    However, if I remove my_project_name.a from the directory, it complains about it missing. I tried removing my_project_name.a, and renaming libgodot.iphone.release.fat.a into my_project_name.a, but that leads build errors with some of the Google frameworks.

    At this point I'm just unsure about what exactly I'm supposed to be doing with libgodot.iphone.release.fat.a and my_project_name.a

    To Reproduce Steps to reproduce the behavior: Just try and build iOS as described.

    Smartphone (please complete the following information):

    • Device: iPhone 7
    • Xcode: 11.2.1
    • iOS Version: 13.3
    Reviewed by sjhennion at 2021-01-06 03:00
  • 7. [BUG] Rewarded Ads do not work on Android but Interstitial Ads do

    Describe the bug Running from Godot 3.3 Calling show_rewarded() does not display an ad when I call load_rewarded() the rewarded_loaded variable never changes to true.

    I connected the rewarded_ad_failed_to_load signal and have a print() command in the function and that signal never fires.

    Interstitial ads load just fine.

    I am using the android-standard-template-v3.3.zip for my project.

    To Reproduce Steps to reproduce the behavior:

    1. Unzip android-standard-template-v3.3.zip and put files into res:// of my project
    2. Install plugin to res://android/plugins
    3. Add Project ID to AndroidManifest.xml
    4. Add MobileAds as a singleton
    5. Call MobileAds.load_rewarded() when player character dies
    6. Call MobileAds.show_rewarded() when player pushes the rewarded ad button

    Expected behavior I expect a rewarded ad to work, like it works on iOS when I press the button.

    Screenshots If applicable, add screenshots to help explain your problem. Screenshot_20210507-132820

    Smartphone (please complete the following information):

    • Device: Google Pixel 3
    • OS: Android 11
    • Version

    Additional context I have disabled all other plugins while I try to debug this issue.

    Reviewed by Tekuzo at 2021-05-07 16:26
  • 8. [BUG] [IOS]adView:didFailToReceiveAdWithError: Request Error: No ad to show.

    On android it works great with this plugin This issue is only on IOS When I use the test app id and unit id I get the test ad showing but when I change the ids to mine nothing shows and I have this error: Invalid Request. Cannot determine request type. Is your ad unit id correct? adView:didFailToReceiveAdWithError: Request Error: No ad to show. interstitial:didFailToReceiveAdWithError: Request Error: No ad to show. I'm using those same ids with Shin-NiL plugin and the ads are showing. so I'm pretty sure I did something work while implementing the plugin An other question: How can I print the error code number ?

    Reviewed by anisc at 2021-04-06 18:03
  • 9. [FEATURE] Easily change gdpr settings after they have already been set

    Is your feature request related to a problem? Please describe. To be gdpr compliant, it is required that the user can easily change the gdpr settings from within the app at any moment they want. For example, having a button called gdpr in the settings of your game could show the original gdpr prompt when you first launch the game. For iOS and Android

    Describe the solution you'd like Just have a function that can be called from GD that would show the gdpr prompt again.

    Describe alternatives you've considered None that I can think of

    Additional context Reference https://www.sourcepoint.com/blog/optimizing-user-opt-in-on-ios-14-idfa-changes/

    Reviewed by Xioor at 2021-05-01 01:55
  • 10. [BUG] EGL_BAD_DISPLAY error

    Describe the bug With latest admob scene game freezes on startup with 03-23 15:35:42.255 3192-3504/com.luminarcy.echoes E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY) error

    To Reproduce Steps to reproduce the behavior:

    1. Enable and configure admob scene.
    2. Deploy game to device.
    3. See error.

    Expected behavior Game should not freeze.

    Screenshots image

    Smartphone (please complete the following information):

    • Device: Xiaomi Redmi Note 4X
    • OS: Android
    • Version 6.0
    Reviewed by Luminarcy at 2021-03-23 12:39
  • 11. [BUG] Unable to Connect to Signals Using C# Script When Accessing AdMob Singleton

    Describe the bug I'm unable to connect to any of the AdMob singleton signals when using a C# script. An error of InvalidParameter is given when I attempt any connection. When listing all of the singleton's signals, only script_changed is available, so no other signals are being registered with the C# Mono classes. This might be happening because of the use of GodotLib.calldeferred in AdMob.java. A solution could be replacing the current implementation with emitSignal because other similar projects have exhibited this bug and have since migrated to this method. Two prominent examples include Shin-Nil's AdMob plugin and Godot's GodotGooglePaymentBilling.

    Here is some documentation on the issue:

    https://github.com/godotengine/godot/issues/40481 https://github.com/Shin-NiL/Godot-Android-Admob-Plugin/issues/55 The issue exhibited with other plugins

    https://github.com/Shin-NiL/Godot-Android-Admob-Plugin/pull/56 https://github.com/Shin-NiL/Godot-Android-Admob-Plugin/pull/56/commits/b557e134fd8dc1185d448ab0b3c3f28f3f1595ac Potential solutions

    To Reproduce Instead of using the GDScript editor plugin, just use a C# script to initialize the AdMob plugin and try connecting to any of the signals.

    Expected behavior The signals should connect.

    Smartphone (please complete the following information): So far, the only platform I tested this on is Android.

    Reviewed by atlasapplications at 2021-08-05 22:51
  • 12. Add clicked and impression signals to all ad types

    Add clicked and impression signals to Insterstitial, Rewarded and Rewarded Interstitial ad types.

    I moved too the Insterstitial setFullscreenContentCallbacks from load_interstitial to show_interstitial method to keep consistency with Rewarded and Rewarded Interstitial that already set fullscreenContentCallbacks on the show methods. Let me know if it's ok.

    Reviewed by gianlluca at 2022-08-05 16:49
  • 13. [BUG] App crash on startup

    Describe the bug This plugin is amazing and has helped me a ton. However it works great unless I export it and run it on Android 12 (anything below that works perfectly). When you install an app with this on Android 12 it just crashes. I think it has something to do with the manifest xml file. When I disable the plugin the app runs perfectly, albiet not making money

    To Reproduce Steps to reproduce the behavior: Make an android game with this Follow the instructions (I think it's the manifest xml file that messes w it) Install on Android 12 Crash on app startup on phone

    Expected behavior App crashes on startup

    Smartphone (please complete the following information):

    • Device: any android running 12
    • OS: android 12
    Reviewed by RintaDev at 2022-08-05 02:26
  • 14. [FEATURE] Mediation for Android and iOS

    Android: https://developers.google.com/admob/android/mediate iOS: https://developers.google.com/admob/ios/mediate

    Why mediate is good: https://www.youtube.com/watch?v=ie6cwaaOFrY

    Reviewed by gumaciel at 2020-12-19 12:26
A Template for a Github Actions Pipeline for building and publishing Gradle-JVM Applications

github-actions-cd-template-jvm A Template for a Github Actions Pipeline for building and publishing Gradle-JVM Applications It build a executable shad

Dec 5, 2021
Android + Kotlin + Github Actions + ktlint + Detekt + Gradle Kotlin DSL + buildSrc = ❤️

kotlin-android-template ?? A simple Github template that lets you create an Android/Kotlin project and be up and running in a few seconds. This templa

Aug 4, 2022
GitHub Actions Kotlin DSL

GitHub Actions Kotlin DSL Work in progress! The goal is to be able to describe GH Actions in Kotlin with all its perks, like: workflow( name = "Te

Aug 1, 2022
A Mindustry mod adding turrets from older versions of Mindustry, specifically Mindustry Classic

Mindustry Kotlin Mod Template A Kotlin Mindustry mod that works on Android and PC. This is equivalent to the Java version, except in Kotlin. Building

Feb 14, 2022
ListUtil.kt ListUtils - Advance list functions from kotlin standard library
ListUtil.kt ListUtils - Advance list functions from kotlin standard library

ListUtils - Advance list functions from kotlin standard library A set of utility functions to work with lists in a robust way. It is based on a patter

May 6, 2022
Kotlin/JVM compensated summation of Double sequences to calculate sum, mean, standard deviation

precise Implements compensated summation for sequences of Double. Reduces rounding errors associated with limited precision of floating-point numbers.

Apr 20, 2022
Unofficial Actions on Google SDK for Kotlin and Java
Unofficial Actions on Google SDK for Kotlin and Java

Actions On Google Client Library This is a port of the official Node.js SDK to Kotlin. This can also be used from Java and any JVM language. Quick Fac

Jul 5, 2022
Mobile Application Dvelopment Practical-12: Working with JSON APIs
Mobile Application Dvelopment Practical-12: Working with JSON APIs

Mobile Application Dvelopment Practical-12: Working with JSON APIs Developed by,

Jan 11, 2022
BetterNBT - A Gson-like API for intuitively working with Minecraft NBTs

BetterNBT A lightweight (under 250 lines of code) Kotlin library for Fabric 1.18

Apr 13, 2022
A library for working with URIs in Kotlin Multiplatform

Uri KMP Most of this work is derived from AOSP's Uri: Uri.java UriCodec.java UriTest.java UriCodecTest.java Gradle Groovy repositories { mavenCentra

Jul 7, 2022
The AppMetrica Push SDK is a set of libraries for working with push notifications.
The AppMetrica Push SDK is a set of libraries for working with push notifications.

Flutter AppMetrica Push AppMetrica Push SDK — это набор библиотек для работы с push-уведомлениями. Подключив AppMetrica Push SDK, вы можете создать и

Aug 9, 2022
Actions are things that run, with parameters. Serves as a common dependency for a variety of Cepi extensions.

Actions Actions that take in customizable paramaters, an optional target, and do things. Installation Download the jar from Releases OR compile it you

Jan 9, 2022
A composite Github Action to execute the Kotlin Script with compiler plugin and dependency caching!

Kotlin Script Github Action Kotlin can also be used as a scripting language, which is more safer, concise, and fun to write than bash or python. Githu

Jun 19, 2022
Plugin-shared-preferences - Pluto plugin to manage your Shared Preferences

Pluto Shared Preferences Plugin Pluto Shared Preferences is a Pluto plugin to in

Feb 14, 2022
An open source GitHub Android client app, faster and concise.
An open source GitHub Android client app, faster and concise.

An open-source GitHub Android client app, faster and concise.

Aug 5, 2022
A sample application that build with combine use Clean Architecture framework and Github API
A sample application that build with combine use Clean Architecture framework and Github API

The Github Example Introduction This is a sample application that build with combine use Clean Architecture framework and Github API (https://develope

Aug 5, 2022
AndroidappTemplate - A GitHub template repository intended to kickstart development on an Android application

Android App Template This is a GitHub template repository intended to kickstart

Jan 7, 2022
io.github.jakob.AgonesClient - Kotlin client library for sdk.proto

io.github.jakob.AgonesClient - Kotlin client library for sdk.proto Requires Kotlin 1.3.41 Gradle 4.9 Build First, create the gradle wrapper script: gr

Jun 24, 2022
🔨 Template for easy hosting of your Java/Kotlin libraries on GitHub

?? kotlin-jvm-library-template Another template for easy hosting your Java/Kotlin libraries on GitHub. Features boilerplate for Kotlin/Java projects w

Jan 7, 2022