我有一个React Native App,当用户单击一个按钮时,我调用一个函数,该函数_openInterstitial返回2个Promise。
代码如下:
_openInterstitial = async () => {
try {
await AdMobInterstitial.requestAdAsync()
await AdMobInterstitial.showAdAsync()
} catch (error) {
console.error(error)
}
}
当我快速点击按钮两次时,它返回此错误
已经在请求广告,请等待之前的承诺。
我如何履行await先前的承诺?
我是否需要将另一个await带到另一个try..catch街区?
还有其他更简单的方法吗?
慕丝7291255
相关分类