Closed ThomasOrgeval closed 2 hours ago
There is nothing called automatically on the plugin side. If you use a browser in responsive mode with iOS or Android, capacitor will still think you are on device.
Calling or not init
doesn't prevent calls to another methods by the consumer code.
I never call another methods by myself, how is it possible then?
The message "Skipping AdMob initialization on web" just appear when you call init on web. Something is wrong with you code. It is not part of the plugin.
I am 100% sure of this friend.
Okay, I'll take a look at what's wrong, thanks for your reply!
Describe the bug
Despite implementing platform checks to only initialize AdMob on mobile platforms (iOS, Android), the methods
requestConsentInfo
andshowConsentForm
are being called repeatedly on the web version of my application. These calls should not be triggered in a web environment.To Reproduce
Steps to reproduce the behavior:
Expected behavior
AdMob methods should not be called on the web platform. These methods should only be triggered when the app is running on mobile devices (iOS, Android). On the web, AdMob initialization should be skipped entirely.
Desktop:
OS: Windows 11 Browser: Chrome 131 Version: Capacitor v6, AdMob plugin v6
Additional context
The platform detection seems correct, as logs indicate that AdMob initialization is skipped on the web (Skipping AdMob initialization on web). However, the requestConsentInfo and showConsentForm methods are still being triggered, leading me to believe there may be an issue with the plugin automatically calling these methods, even in the web environment.
Platform detection code: