'async/await use in ios 12 with react native

I'm creating a simple app using react native (using expo) and I want to use Google Admob's interstitial ads. I would like the application to wait for the advertising to finish before continuing with the code. I am currently using async/await. On android it works very well, but on ios devices (ipod touch ios 12 and simulator ios 12) async/await doesn't work, the application continues to run in the background while the ad runs.

Can't figure out how to fix it?

The code I use to run is something similar to this:

const showInterstitial=async()=> {

 await AdMobInterstitial.showAdAsync();

 interDisp=false;

}

I tried to use .then/.catch but it didn't work either. Thanks !



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source