capacitor-community / admob

Community plugin for using Google AdMob
MIT License
205 stars 66 forks source link

[WARN] Capacitor WebPlugin "AdMob" config object was deprecated in v3 and will be removed in v4. #303

Open KiddoV opened 6 months ago

KiddoV commented 6 months ago

Describe the bug I encountered a warning when first initialize the plug in.

Capacitor WebPlugin "AdMob" config object was deprecated in v3 and will be removed in v4.

Screenshots warn

What does this mean and how do I get rid of it?

Desktop (please complete the following information):

Smartphone (please complete the following information):

distante commented 6 months ago

This is just a warning. Should be easily fixed though.

KiddoV commented 5 months ago

How do you fix it? I would like my console to be cleaner. Thanks,

distante commented 5 months ago

You will need to update the web version of the plugin.

KiddoV commented 5 months ago

I ran npm install @capacitor-community/admob@latest It still have the warning.

distante commented 5 months ago

I ran npm install @capacitor-community/admob@latest It still have the warning.

I mean in the source code of the plugin.

KiddoV commented 5 months ago

I see, but it is not a good practice to change the source code.

I think I will just do it like this:

if (Capacitor.isNativePlatform()) {
    admobInitialize();
}

Since my app is only on mobile platform.

folsze commented 4 months ago

Is it possible that this still shows up for you, even after adding the if-statement? I am not entirely sure but I think for me it does

KiddoV commented 4 months ago

After adding the if statement, it will ensure AdMob only run on mobile platform, so I am certain this warning will no longer display on the web platform when you open it in a browser. You can try for yourself and see.