admob-plus: App crash - Banner ad
I checked interstitial ad, it working. But the banner ad is not working, the app is crashed with the following error while show the banner ad.
Error : java.lang.IllegalStateException: The ad size and ad unit ID must be set before loadAd is called.
My code is
import { AdMobPlus as AdMob, BannerAd,InterstitialAd,AdSize ,
/* BannerAdOptions, InterstitialAdOptions, RewardedAdOptions, AppOpenAdOptions,Consent, */
TrackingAuthorizationStatus } from '@admob-plus/capacitor';
export async function initAds() {
AdMob.addListener('banner.load', (info) => {
console.log('banner.load', info)
})
const banner = new BannerAd({
adUnitId: 'ca-app-pub-3940256099942544/6300978111',
position: 'top',
})
await banner.show()
}
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 1
- Comments: 15 (4 by maintainers)
Overlap is no issue for me (but I don’t use ‘app open’).
After all, we can develop this plugin all together.
Same issue here. Any solution please? @merbin2012 merbin2012 did you get any fix?