I have a simple function where I want to show an add-on the button click but there is a problem if the user clicks the button for the first time then this event is called one. if the user clicks the button a second time then it is called 2 times and the third time the there time and so on. Here is my code.
const searchnumber = () =>{
AdMobInterstitial.showAd().catch(error => {
// i want to navigate to another secrren but for firt time it navigate one if clcik the button second time then it navigates two time
console.log('Show ad Error ad')
});
AdMobInterstitial.addEventListener('adClosed', () => {
console.log('ad closed')
AdMobInterstitial.requestAd().catch(error => {});
});
}
I have a simple function where I want to show an add-on the button click but there is a problem if the user clicks the button for the first time then this event is called one. if the user clicks the button a second time then it is called 2 times and the third time the there time and so on. Here is my code.