Explore-In-HMS / huawei.ads.admob_mediation

26 stars 12 forks source link

[Unity] Context is null error #35

Closed megaacheyounes closed 1 year ago

megaacheyounes commented 1 year ago

Hi guys,

I have integrated version 2.0.2 to show Banner ads in unity, and I'm seeing "context is null" in the logs:

2023-02-03 16:10:26.511 12396-12396/? D/AdsUnity: Calling loadAd() on Android
2023-02-03 16:10:27.443 12396-12396/? D/HuaweiBannerCustomEventLoader: BannerEventLoader - loadAd()
2023-02-03 16:10:27.443 12396-12396/? D/HuaweiBannerCustomEventLoader: BannerEventLoader - loadAd() - Context is null, an activity context is required to show the ad

the error is printed here: https://github.com/Explore-In-HMS/huawei.ads.admob_mediation/blob/deb4ef1e20/admob_mediation/src/main/java/com/hmscl/huawei/admob_mediation/BannerAds/HuaweiBannerCustomEventLoader.kt#L82

Assuming that I have setup AdManager waterfall to show Huawei ads, then fallback to Google Ads, and the banner always loads Google Ads, does this mean this "context is null" is an issue with my setup/configuration? or is it normal behavior?

megaacheyounes commented 1 year ago

seems like the error happens when the Huawei ad unit ID is not set as a parameter in google Ad Manager