{"id":14961481,"url":"https://github.com/shin-nil/godot-android-admob-plugin","last_synced_at":"2025-05-15T11:07:32.862Z","repository":{"id":38712229,"uuid":"192226296","full_name":"Shin-NiL/Godot-Android-Admob-Plugin","owner":"Shin-NiL","description":"Android AdMob plugin for Godot Game Engine 3.2 or higher","archived":false,"fork":false,"pushed_at":"2024-10-17T17:34:49.000Z","size":475,"stargazers_count":549,"open_issues_count":47,"forks_count":65,"subscribers_count":29,"default_branch":"main","last_synced_at":"2025-04-14T19:57:19.435Z","etag":null,"topics":["admob","android","godot","godot-engine","plugin"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Shin-NiL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"shinnil","custom":["https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=3MJE3M4FMJYGN\u0026lc=BR\u0026item_name=Shin%2dNiL%27s%20Github\u0026item_number=Github\u0026currency_code=USD\u0026bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted"]}},"created_at":"2019-06-16T18:56:55.000Z","updated_at":"2025-04-10T00:21:00.000Z","dependencies_parsed_at":"2024-09-24T13:42:52.712Z","dependency_job_id":"9e6d89c3-7207-4895-ad3a-0555c0f9fcc2","html_url":"https://github.com/Shin-NiL/Godot-Android-Admob-Plugin","commit_stats":{"total_commits":128,"total_committers":20,"mean_commits":6.4,"dds":0.296875,"last_synced_commit":"330c25167763a25d0c0d1c7352224611dfdb9116"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shin-NiL%2FGodot-Android-Admob-Plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shin-NiL%2FGodot-Android-Admob-Plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shin-NiL%2FGodot-Android-Admob-Plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shin-NiL%2FGodot-Android-Admob-Plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shin-NiL","download_url":"https://codeload.github.com/Shin-NiL/Godot-Android-Admob-Plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254328384,"owners_count":22052632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["admob","android","godot","godot-engine","plugin"],"created_at":"2024-09-24T13:25:19.705Z","updated_at":"2025-05-15T11:07:32.809Z","avatar_url":"https://github.com/Shin-NiL.png","language":"Java","funding_links":["https://ko-fi.com/shinnil","https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=3MJE3M4FMJYGN\u0026lc=BR\u0026item_name=Shin%2dNiL%27s%20Github\u0026item_number=Github\u0026currency_code=USD\u0026bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted"],"categories":[],"sub_categories":[],"readme":"# GodotAdMob\n\nThis is an Android AdMob plugin for Godot Engine (https://github.com/okamstudio/godot) 3.2.2 or higher. For Godot \u003c 3.2 or iOS support you can use the [old module](https://github.com/kloder-games/godot-admob).\n\nCurrently, this plugin supports:\n- Banner\n- Interstitial\n- Rewarded Video\n- [Rewarded Interstitial](https://developers.google.com/admob/android/rewarded-interstitial)\n\n## Setup\n\n### Video Guide\nOur friend *dQuigz* created a [nice video tutorial on how to use this plugin](https://youtu.be/0a6EvlNgLL0).\n\n### Text Instructions\n- Configure, install  and enable the \"Android Custom Template\" for your project, just follow the [official documentation](https://docs.godotengine.org/en/stable/getting_started/workflow/export/android_custom_build.html);\n- go to the [release tab](https://github.com/Shin-NiL/Godot-Android-AdMob-Plugin/releases), choose a version and download the respective ```GodotAdMobPlugin-x.x.x.zip``` package;\n- extract the content of the ```admob-plugin``` directory (```GodotAdmob.gdap``` and ```GodotAdmob.release.aar``` from the zip package) inside the ```res://android/plugins``` directory on your Godot project.\n- extract the ```admob-lib``` directory (from the zip package) inside the ```res://``` directory on your Godot project.\n- on the Project -\u003e Export... -\u003e Android -\u003e Options -\u003e\n    - Permissions: check the permissions for _Access Network State_ and _Internet_\n    - Custom Template: check the _Use Custom Build_\n    - Plugins: check the _Godot Ad Mob_ (this plugin)\n- edit the file ```res://android/build/AndroidManifest.xml``` to add your App ID as described [here](https://developers.google.com/admob/android/quick-start#update_your_androidmanifestxml). For the demo project, for example, you should use:\n```\n        \u003cmeta-data\n            android:name=\"com.google.android.gms.ads.APPLICATION_ID\"\n            android:value=\"ca-app-pub-3940256099942544~3347511713\"/\u003e\n```\nOne good place to add this metadata is just below these lines, inside of the **application** tag:\n```\n\u003capplication\u003e\n...\n\u003c!-- Custom application XML added by add-ons. --\u003e\n\u003c!--CHUNK_APPLICATION_BEGIN--\u003e\n\u003c!--CHUNK_APPLICATION_END--\u003e\n\nHere\n\u003c/application\u003e\n```\n- To avoid the mergeDex error, enable the multidex support. Edit the file ```res://android/build/build.gradle``` and insert the line `multiDexEnabled = true` inside the `android` =\u003e `defaultConfig`:\n```\nandroid {\n    defaultConfig {\n        ...\n        multiDexEnabled = true\n        ...\n    }\n}\n```\n\n\n**NOTE**: everytime you install a new version of the Android Build Template this step must be done again, as the ```AndroidManifest.xml``` file will be overriden.\n\n\nNow you'll be able to add an AdMob Node to your scene (**only one node should be added per scene**)\n\n![Searching AdMob node](images/search_node.png)\n\nEdit its properties\n\n![AdMob properties](images/properties.png)\n\nAnd connect its signals\n\n![AdMob signals](images/signals.png)\n\n## Sample Code\n\nIn the demo directory you'll find a working sample project where you can see how the things works on the scripting side.\n\n__REMEMBER__: You still need to configure the project as described in the \"Setup\" section to be able to run the demo project.\n\n## Showcase\n\nDoes this plugin really work? Yes sir! You can see a list of published games [here](showcase.md).\n\n\n## Donations\n\nWas this project useful for you? Wanna make a donation? These are the options:\n\n### Paypal\n\nMy [Paypal donation link](https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=3MJE3M4FMJYGN\u0026lc=BR\u0026item_name=Shin%2dNiL%27s%20Github\u0026item_number=Github\u0026currency_code=USD\u0026bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)\n\n### Brave Browser\nIf you're a Brave browser user, please consider donating some BATs ;)\n\n\n## API Reference\n\n### Properties\n```python\n# If true use your real ad, if false use test ads. Make sure to only set it to true with your published apk, otherwise you can be banned by Google\n# type bool, default false\nis_real\n\n# If true, displays banner on the top of the screen, if false displays on the bottom\n# type bool, default true\nbanner_on_top\n\n# The banner size constants\n# Valid values are: \"ADAPTIVE_BANNER\", \"SMART_BANNER\", \"BANNER\", \"LARGE_BANNER\", \"MEDIUM_RECTANGLE\", \"FULL_BANNER\", \"LEADERBOARD\"\nbanner_size\n\n# Your app banner ad ID\n# type String, optional\nbanner_id\n\n# Your app interstitial ad ID\n# type String, optional\ninterstitial_id\n\n# Your app rewarded video ad ID\n# type String, optional\nrewarded_id\n\n# Your app rewarded interstitial ad ID\n# type String, optional\nrewarded_interstitial_id\n\n# If true, set the ads to children directed. If true, max_ad_content_rate will be ignored (your max_ad_content_rate would can not be other than \"G\")\n# type bool, default false\nchild_directed\n\n# If ads should be personalized. In the European Economic Area, GDPR requires ad personalization to be opt-in.\n# type bool, default true\nis_personalized\n\n# Its value must be \"G\", \"PG\", \"T\" or \"MA\". If the rating of your app in Play Console and your config of max_ad_content_rate in AdMob are not matched, your app can be banned by Google\n# type String, default G\nmax_ad_content_rate\n\n# If true, ads should be displayed after consent verification (calling method request_consent_info_update())\nads_using_consent\n\n# True for testing purpose only\n# False for production environment\ntesting_consent\n```\n\n### Methods\n```python\n\n# Initialize AdMob on a background thread for optimization\ninitialize_on_background_thread()\n\n# Load the banner (and show inmediatly)\nload_banner()\n\n# Load the interstitial ad\nload_interstitial()\n\n# Load the rewarded video ad\nload_rewarded_video()\n\n# Load the rewarded interstitial ad\nload_rewarded_interstitial()\n\n# Show the banner ad\nshow_banner()\n\n# Hide the banner ad\nhide_banner()\n\n# Move banner after loaded\nmove_banner(on_top: bool)\n\n# Show the interstitial ad\nshow_interstitial()\n\n# Show the rewarded video ad\nshow_rewarded_video()\n\n# Show the rewarded interstitial ad\nshow_rewarded_interstitial()\n\n# Check if the interstitial ad is loaded\n# @return bool true if is loaded\nis_interstitial_loaded()\n\n# Check if the rewarded video ad is loaded\n# @return bool true if is loaded\nis_rewarded_video_loaded()\n\n# Check if the rewarded interstitial ad is loaded\n# @return bool true if is loaded\nis_rewarded_interstitial_loaded()\n\n# Resize the banner (useful when the orientation changes for example)\nbanner_resize()\n\n# Get the current banner dimension\n# @return Vector2 (width, height)\nget_banner_dimension()\n\n# Verify consent status\nrequest_consent_info_update()\n\n# Reset consent status\n# Should by called only for testing purpose OR 'if you decide to remove the UMP SDK completely from your project.'\n# See: https://developers.google.com/admob/android/privacy#reset_consent_state\nreset_consent()\n\n```\n### Signals\n```python\n# AdMob Background Initialization Success\nadmob_initialized\n\n# Banner ad was loaded with success\nbanner_loaded\n\n# Banner ad has failed to load\n# @param int error_code the error code\nbanner_failed_to_load(error_code)\n\n# Interstitial ad was loaded with success\ninterstitial_loaded\n\n# Interstitial ad was opened\ninterstitial_opened\n\n# Interstitial ad was closed\ninterstitial_closed\n\n# Interstitial ad has failed to load\n# @param int error_code the error code\ninterstitial_failed_to_load(error_code)\n\n# Interstitial ad has been clicked\ninterstitial_clicked\n\n# The user has provided an interstitial impression.\ninterstitial_impression\n\n# Rewarded video ad was loaded with success\nrewarded_video_loaded\n\n# Rewarded video ad was opened\nrewarded_video_opened\n\n# Rewarded video ad was closed\nrewarded_video_closed\n\n# Rewarded video ad has failed to load\n# @param int error_code the error code\nrewarded_video_failed_to_load(error_code)\n\n# Rewarded interstitial ad was loaded with success\nrewarded_interstitial_loaded\n\n# Rewarded interstitial ad was opened\nrewarded_interstitial_opened\n\n# Rewarded interstitial ad was closed\nrewarded_interstitial_closed\n\n# Rewarded interstitial ad has failed to load\n# @param int error_code the error code\nrewarded_interstitial_failed_to_load(error_code)\n\n# Rewarded interstitial ad has failed to show\n# @param int error_code the error code\nrewarded_interstitial_failed_to_show(error_code)\n\n# Rewarded video/interstitial ad was watched and will reward the user\n# @param String currency The reward item description, ex: coin\n# @param int amount The reward item amount\nrewarded(currency, amount)\n\n# Rewarded video was clicked\nrewarded_clicked\n\n# The user has given an impression for a rewarded video.\nrewarded_impression\n\n# Good for nothing. Only used for debug information. \nconsent_info_update_success\n\n# Error on consent verification\nconsent_info_update_failure(error_code, error_message)\n\n# Now you can show ads to user\nconsent_app_can_request_ad(consent_status)\n```\n\n## Compiling the Plugin (optional)\n\nIf you want to compile the plugin by yourself, it's very easy:\n1. Clone this repository;\n2. Checkout the desired version;\n3. Download the AAR library for Android plugin from the official Godot website;\n4. Copy the downloaded AAR file into the `admob-plugin/godot-lib.release/` directory and rename it to `godot-lib.release.aar`;\n5. Configure the demo project according to the \"Setup\" instructions. Install the \"Android Custom Template\" for the demo project. This generates the required build configuration.\n6. Using command line go to the `admob-plugin/` directory;\n7. Run `gradlew build`.\n\nIf everything goes fine, you'll find the `.aar` files at `admob-plugin/godotadmob/build/outputs/aar/`.\n\n## Troubleshooting\n\n* First of all, please make sure you're able to compile the custom build for Android without the AdMob plugin, this way we can isolate the cause of the issue.\n\n* Using logcat for Android is the best way to troubleshoot most issues. You can filter Godot only messages with logcat using the command:\n```\nadb logcat -s godot\n```\n* _AdMob Java Singleton not found_:\n    1. this plugin is Android only, so the AdMob Java singleton will only exists on the Android platform. In other words, you will be able to run it on an Android device (or emulator) only, it will not work on editor or on another platform;\n    2. make sure you checked the _Use Custom Build_ and _Godot Ad Mob_ options in the export window.\n\n* App is crashing at startup: use the `logcat` to check what's happening. It can be caused for many different reasons, if you forgot to or not configure correctly you App ID on the `AndroidManifest.xml`, for example, your app will crash.\n\n* Error code 3 (_ERROR_CODE_NO_FILL_) is a common issue with Admob, but out of the scope to this plugin. Here's the description on the API page: [ERROR_CODE_NO_FILL: The ad request was successful, but no ad was returned due to lack of ad inventory.](https://developers.google.com/android/reference/com/google/android/gms/ads/AdRequest.html#ERROR_CODE_NO_FILL)\n\n* Any other error code: you can find more information about the error codes [here](https://support.google.com/admob/thread/3494603). Please don't open issues on this repository asking for help about that, as we can't provide any, sorry.\n\n* Banner sizes: [Adaptive Banners](https://developers.google.com/admob/android/banner/adaptive) and [Smart Banners](https://developers.google.com/admob/android/banner/smart) uses dynamic banner sizes, the [other options](https://developers.google.com/admob/android/banner) uses fixed sizes, please check its respectives documentation for more details. Smart banners are deprecated and may not work properly.\n\n## Optimize AdMob\n\nTo prevent [\"Application Not Responding\" (ANR)](https://developer.android.com/topic/performance/vitals/anr) issues, you can follow some of the optimization strategies mentioned below.\n\nBefore making any method calls to load ads, call `initialize_on_background_thread()` to initialize AdMob. The signal `admob_initialized` will be triggered, indicating that the initialization was successful.\n\nAlternatively, you can update your manifest with the optimization flag `OPTIMIZE_INITIALIZATION` to improve initialization without using a background thread.\n\nYou can also use the `OPTIMIZE_AD_LOADING` flag to improve ad loading performance.\n\nLearn more at [Optimize initialization and ad loading (Beta)](https://developers.google.com/admob/android/optimize-initialization).\n\n\n## References\n\nBased on the works of:\n* https://github.com/Mavhod/GodotAdmob\n* https://github.com/kloder-games/godot-admob\n\n## License\n\nMIT license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshin-nil%2Fgodot-android-admob-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshin-nil%2Fgodot-android-admob-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshin-nil%2Fgodot-android-admob-plugin/lists"}