poingstudios / godot-admob-android Goto Github PK
View Code? Open in Web Editor NEWGodot's AdMob Plugin for Android with support for Mediations.
Home Page: https://poingstudios.github.io/godot-admob-plugin/
License: MIT License
Godot's AdMob Plugin for Android with support for Mediations.
Home Page: https://poingstudios.github.io/godot-admob-plugin/
License: MIT License
On Android version, if your app is to children directed and the ads are not target to this, your app could be banner, on iOS this doesnt happen, but is good to have it because iOS some day can add it, or we just dont want to our users to see improper ads.
*stable_linux_headless.64.zip
"*stable_export_templates.tpz
"android_source.zip
" from .tpz, to "examples/android/build
"The module only supports now 3.1.2 version, needs to update to get into new projects of Godot Engine
https://godotengine.org/article/godot-3-2-will-get-new-android-plugin-system
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 ?
Xcode is returning
Error Thread 1: EXC_BAD_ACCESS (code=1, address=0x40)
When enable banner ads
The banner layout params have a gravity param, that define the position of the banner: https://developer.android.com/reference/android/view/Gravity, the variables that sets the gravity is being setted on GD code, the value of the variables are the constant value of gravity position.
The objective is do the same as are on Android, but the constants on iOS are very different, so the option now is doing with some if case or switch case
the center and no gravity could be removed to Android version if not very good use
Hello, I am a bit confused on how to implement the ad code with this module, also, do I need to do anything with the debug.a and release.a files?
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:
Expected behavior
Game should not freeze.
Smartphone (please complete the following information):
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:
To Reproduce
Steps to reproduce the behavior:
ios/admob
contents into godot/modules/admob
*.framework
directories into godot/modules/admob/lib
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):
Describe the bug
On my project I have firebase and facebook (DrMoriarty), it build and run but every time I add this plugin I get this error :
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
The number of method references in a .dex file cannot exceed 64K.
Smartphone (please complete the following information):
I'm building on an android S9 using macos
If you open the app and try to enable and destroy the Unified Native AD at the same time, the AD will no longer allow disable
Must do it to avoid the error: Multiple locks on web thread not allowed
How do it: removeFromSuperview the bannerView and set nil on him
Describe the bug
When try to run on a simulator on Xcode, givies a error telling GoogleMobileAds not work on Simulator devices.
When trying to build with xcode 12.4 with godot 3.2.3 stable xcode show an error : Framework not found GoogleAppMeasurement
I tryied deleting and adding the framework several times and is not working, also adding the framework from general, frameworks, libraries, and embededded content is the same.
modules/admob/src/AdMob.mm:36:13:{36:13-36:24}: warning: receiver 'AdMobBanner' is a forward class and corresponding @interface may not exist [-Wreceiver-forward-class,2]
banner = [[AdMobBanner alloc] init];
^~~~~~~~~~~
modules/admob/src/AdMob.h:8:8: note: forward declaration of class here [2]
@Class AdMobBanner;
^
/Applications/Xcode_12.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk/usr/include/objc/NSObject.h:71:1: note: method 'alloc' is used for the forward class [2]
Repository: https://github.com/Poing-Studios/Godot-AdMob-Editor-Plugin
Is your feature request related to a problem? Please describe.
The way in which Godot's AdMob attributes are handled is not so friendly to all users, an editor plugin will make data manipulation much simpler.
Describe the solution you'd like
Currently there is already a very complete editor plugin, this is the repository: https://github.com/fenix-hub/godot-engine.github-integration. Our plugin will be much simpler than this one, I believe it will only have 2 scripts
It contains 3 things that I found super interesting:
One of which is that the GitHub feature appears on the Top, next to the 2D, 3D, Script, AssetLib scene (I manually disabled 3D and AssetLib):
The second thing, is that this tab is a screen for logging into GitHub and later committing, etc (in our case, it will serve to inform the data, example: AdMob Enabled, Banner Size, Unit Ids, etc.):
And the last thing is to add singletons automatically (this would add "admob_api.gd" and any Script from Godot will be able to call the functions to open an interstitial, reward, etc.):
Describe alternatives you've considered
Continue using "admob_api.gd" for now until complete the plugin editor
Additional context
To make this happen, it will be necessary to create a new separate repository, because to add to AssetLib you need to include the repository link, if we did in that repository you would have problems importing the plugin
Need to load interstitial like Android version
Guide: https://developers.google.com/admob/ios/interstitial#load_an_ad
Need to show interstitial like as Android
Guide: https://developers.google.com/admob/ios/interstitial#show_the_ad
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/
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)
Apple has indicated that obtaining permission to track users will be required starting early 2021 and not with the release of iOS14 as initially indicated: "To give developers time to make necessary changes, apps will be required to obtain permission to track users starting early next year." (from https://developer.apple.com/news/?id=hx9s63c5)
https://developer.apple.com/documentation/apptrackingtransparency
Describe the bug
Sometimes now on banner disable click the keyboard opens
To Reproduce
Steps to reproduce the behavior:
Smartphone (please complete the following information):
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):
Guide: https://developers.google.com/admob/ios/rewarded-ads or https://developers.google.com/admob/ios/rewarded-migration
Please use the New API
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
The Android version supports all different banner sizes on AdMob: https://github.com/Poing-Studios/GodotAdMob/blob/master/admob/android/java/AdMob.java#L85
The objective is doing the same on iOS version, here are the sizes of AdMob Banner on iOS: https://developers.google.com/admob/ios/banner#banner_sizes
The gravity of the view of banner ads should be only bottom centered or top centered due good practices of using AdMob Banners, changing the name for "position" will be more easily to understand how works and limiting for Bottom or Top will avoid to some user use wrong the Banner Ad.
Guide: https://developers.google.com/admob/ios/banner#implementing_banner_events
Must be the same as Android version https://developers.google.com/admob/ios/banner#implementing_banner_events
Describe the bug
Trying to compile for ios but getting this error at 9%:
`anischandoul@aniss-MacBook-Pro godot-3.2.3-stable % scons p=iphone tools=no target=release arch=arm
scons: Reading SConscript files ...
Checking for C header file mntent.h... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
[ 9%] Compiling ==> modules/admob/src/AdMob.mm
clang: warning: optimization flag '-fomit-frame-pointer' is not supported for target 'armv7' [-Wignored-optimization-argument]
In file included from modules/admob/src/AdMob.mm:1:
In file included from modules/admob/src/AdMob.h:7:
modules/admob/src/Interstitial.h:9:36: error: no type or protocol named 'GADInterstitialDelegate' [25]
@interface Interstitial: NSObject {
^
modules/admob/src/Interstitial.h:10:5: error: unknown type name 'GADInterstitial'; did you mean 'GADInterstitialAd'? [2]
GADInterstitial *interstitial;
^~~~~~~~~~~~~~~
GADInterstitialAd
fix-it:"modules/admob/src/Interstitial.h":{10:5-10:20}:"GADInterstitialAd"
modules/admob/lib/GoogleMobileAds.xcframework/ios-arm64_armv7/GoogleMobileAds.framework/Headers/GADInterstitialAd.h:28:12: note: 'GADInterstitialAd' declared here [2]
@interface GADInterstitialAd : NSObject
^
In file included from modules/admob/src/AdMob.mm:1:
In file included from modules/admob/src/AdMob.h:8:
modules/admob/src/Rewarded.h:10:32: error: no type or protocol named 'GADRewardedAdDelegate' [25]
@interface Rewarded: NSObject {
^
In file included from modules/admob/src/AdMob.mm:6:
In file included from modules/admob/lib/GoogleMobileAds.xcframework/ios-arm64_armv7/GoogleMobileAds.framework/Headers/GoogleMobileAds.h:40:
In file included from modules/admob/lib/GoogleMobileAds.xcframework/ios-arm64_armv7/GoogleMobileAds.framework/Headers/GADCustomNativeAd.h:11:
modules/admob/lib/GoogleMobileAds.xcframework/ios-arm64_armv7/GoogleMobileAds.framework/Headers/GADMediaView.h:27:1: warning: no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed [-Wobjc-property-no-attribute,2]
@Property(nonatomic, nullable) GADMediaContent *mediaContent;
^
modules/admob/lib/GoogleMobileAds.xcframework/ios-arm64_armv7/GoogleMobileAds.framework/Headers/GADMediaView.h:27:1: warning: default property attribute 'assign' not appropriate for object [-Wobjc-property-no-attribute,2]
In file included from modules/admob/src/AdMob.mm:8:
In file included from modules/admob/lib/UserMessagingPlatform.xcframework/ios-arm64_armv7/UserMessagingPlatform.framework/Headers/UserMessagingPlatform.h:1:
In file included from modules/admob/lib/UserMessagingPlatform.xcframework/ios-arm64_armv7/UserMessagingPlatform.framework/Headers/UMPConsentForm.h:1:
In file included from modules/admob/lib/UserMessagingPlatform.xcframework/ios-arm64_armv7/UserMessagingPlatform.framework/Headers/UMPConsentInformation.h:3:
In file included from modules/admob/lib/UserMessagingPlatform.xcframework/ios-arm64_armv7/UserMessagingPlatform.framework/Headers/UMPRequestParameters.h:1:
modules/admob/lib/UserMessagingPlatform.xcframework/ios-arm64_armv7/UserMessagingPlatform.framework/Headers/UMPDebugSettings.h:15:1: warning: no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed [-Wobjc-property-no-attribute,2]
@Property(nonatomic, nullable) NSArray<NSString *> *testDeviceIdentifiers;
^
modules/admob/lib/UserMessagingPlatform.xcframework/ios-arm64_armv7/UserMessagingPlatform.framework/Headers/UMPDebugSettings.h:15:1: warning: default property attribute 'assign' not appropriate for object [-Wobjc-property-no-attribute,2]
modules/admob/src/AdMob.mm:84:60: warning: 'stringWithCString:' is deprecated: first deprecated in iOS 2.0 - Use +stringWithCString:encoding: instead [-Wdeprecated-declarations,32]
debugSettings.testDeviceIdentifiers = @[ [NSString stringWithCString: getDeviceId()] ];
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:525:1: note: 'stringWithCString:' has been explicitly marked deprecated here [2]
before this error there was another error about on interstitial.h:
#import <GoogleMobileAds/GADInterstitial.h> I changed it to #import <GoogleMobileAds/GADInterstitialAd.h>
To Reproduce
terminal and scons p=iphone tools=no target=release arch=arm
tried with master and 3.0_3.2.3 branch
and GoogleMobileAdsSdkiOS-8.3.0 and 7.69.0
Smartphone (please complete the following information):
Must be added to accept the EU Consent https://developers.google.com/admob/ios/eu-consent#forward-consent
Hi, I tried both 3.2.2 and 3.2.3 example projects, they seem to work but only partially - banner and unified_native can be shown.
The problem is I can't find a place where any signal is connected to the plugin singleton. No any signals are emitted from AdMob.tscn.
After adding these lines:
_admob_singleton.initialize(is_for_child_directed_treatment, is_personalized, max_ad_content_rating, is_real, get_instance_id())
_is_initialized = !_is_initialized
_admob_singleton.connect("banner_loaded", self, "_on_admob_singleton_banner_loaded")
I got an error:
12-07 01:29:37.508 11965 12056 E godot : **ERROR**: In Object of type 'JNISingleton': Attempt to connect nonexistent signal 'banner_loaded' to method 'Control._on_admob_singleton_banner_loaded'.
12-07 01:29:37.508 11965 12056 E godot : At: core/object.cpp:1503:connect() - Condition "!signal_is_valid" is true. Returned: ERR_INVALID_PARAMETER
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Any signals working
Smartphone (please complete the following information):
Describe the bug
I'm attempting to run the sample project on an LG G3 Android. The project works and deploys correctly, but none of the buttons seemed to be doing anything for me. After some digging, I've made the following modification to admob_api/AdMob.gd
's ready function:
func _ready():
if admob_enabled:
if (Engine.has_singleton("AdMob")):
_admob_singleton = Engine.get_singleton("AdMob")
#_admob_singleton = self
print("admob singleton: %s" % _admob_singleton)
_initialize()
# warning-ignore:return_value_discarded
get_tree().connect("screen_resized", self, "_on_get_tree_resized")
else:
print("Singleton check fails")
And when debugging, it prints "Singleton check fails". I'm a little confused about the fact that AdMob.tscn is a Autoload Singleton that gets checked, when the check is already being called from within AdMob.gd, which I think is the script for AdMob.tscn.
Regardless, am I missing something setup wise? I've gone through the install instructions, setup Android custom build and everything seems alright from that standpoint, it's just this Singleton loading I can't get working.
To Reproduce
Steps to reproduce the behavior:
Just run the example project with the modifications listed above.
Expected behavior
Expected AdMob singleton to load, and ad callbacks on button presses.
Screenshots
Don't believe any are necessary just yet.
Smartphone (please complete the following information):
Need to redo all iOS module because, theres some classes that we need to use, and we cant do it with the module as it now
Doing this, will make the example/plugin code more clear to Game Programmer
Needs to get the "device_id" directly on module code, to certify the testing ads
Soon Godot will receive the new Plugin System as Android: godotengine/godot#41230
godotengine/godot#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: ?
Is your feature request related to a problem? Please describe.
It's frustrating to have to open the code every time to change the API logic
Describe the solution you'd like
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:
To Reproduce
Steps to reproduce the behavior:
ios/admob
contents into godot/modules/admob
*.framework
directories into godot/modules/admob/lib
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):
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.