Event adDismissed not getting fired, after closing ad
tmjordan opened this issue · comments
tmjordan commented
Description
Expected behavior: Event adDismissed should be triggered when an ad gets closed or dismissed
Actual behavior & steps to reproduce
Nothing happen. Not getting notified after closing an ad
Snack or minimal code example
this.advert = InterstitialAd.createAd(admob_interstitial_id);
this.advert.load();
this.advert.addEventListener('adLoaded', () => {
this.adLoaded = true;
console.warn('Advert ready to show.');
});
this.advert.addEventListener('adDismissed', () => {
Cache.setItem('viewedProfiles', 0);
// this.closeChat();
});
this.advert.addEventListener('adFailedToLoad', error => {
this.adFailedToLoad = true;
console.warn('Advert failed to load.', error);
});
Package versions
- React Native: 0.66.1
- React Native AdMob: 1.1.2
- Google Mobile Ads SDK(if specified):
- Xcode: 13
- Java & Gradle: Gradle 6.9
Affected platforms
- [x ] Android
- [x ] iOS
Jay Kim commented
This is maybe because you loaded ad twice. Ad is loaded automatically unless you specified its option.loadOnMounted
to false
.
Try remove the line this.advert.load()
or create ad with above option for example:
this.advert = InterstitialAd.createAd(admob_interstitial_id, {
loadOnMounted: false
});
Feedback me if it does not work.
Jay Kim commented
Oh, I found you are using previous version. Also you should try version 1.2.1