Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
reloadInterstitial = async () => {
if (!(await AdMobInterstitial.getIsReadyAsync())) {
let isInterstitialReady = false;
try {
await AdMobInterstitial.requestAdAsync({
servePersonalizedAds: this.state.servePersonalizedAds,
});
isInterstitialReady = true;
} catch (e) {
if (e.code === 'E_AD_ALREADY_LOADED') {
isInterstitialReady = true;
} else {
console.warn('AdMobInterstitial.requestAdAsync', e);
}
} finally {
this.setState({ isInterstitialReady });
}
}
reloadInterstitial = async () => {
if (!(await AdMobInterstitial.getIsReadyAsync())) {
let isInterstitialReady = false;
try {
await AdMobInterstitial.requestAdAsync({
servePersonalizedAds: this.state.servePersonalizedAds,
});
isInterstitialReady = true;
} catch (e) {
if (e.code === 'E_AD_ALREADY_LOADED') {
isInterstitialReady = true;
} else {
console.warn('AdMobInterstitial.requestAdAsync', e);
}
} finally {
this.setState({ isInterstitialReady });
}
}
};
reloadRewarded = async () => {
if (!(await AdMobRewarded.getIsReadyAsync())) {
let isRewardedReady = false;
try {
await AdMobRewarded.requestAdAsync({
servePersonalizedAds: this.state.servePersonalizedAds,
});
isRewardedReady = true;
} catch (e) {
if (e.code === 'E_AD_ALREADY_LOADED') {
isRewardedReady = true;
} else {
console.warn('AdMobRewarded.requestAdAsync', e);
}
} finally {
this.setState({ isRewardedReady });
}
}
reloadRewarded = async () => {
if (!(await AdMobRewarded.getIsReadyAsync())) {
let isRewardedReady = false;
try {
await AdMobRewarded.requestAdAsync({
servePersonalizedAds: this.state.servePersonalizedAds,
});
isRewardedReady = true;
} catch (e) {
if (e.code === 'E_AD_ALREADY_LOADED') {
isRewardedReady = true;
} else {
console.warn('AdMobRewarded.requestAdAsync', e);
}
} finally {
this.setState({ isRewardedReady });
}
}
};
get() {
deprecatedModule(
`import { AdMobBanner } from 'expo' -> import { AdMobBanner } from 'expo-ads-admob'`,
'expo-ads-admob'
);
return require('expo-ads-admob').AdMobBanner;
},
},
get() {
deprecatedModule(
`import { AdMobInterstitial } from 'expo' -> import { AdMobInterstitial } from 'expo-ads-admob'`,
'expo-ads-admob'
);
return require('expo-ads-admob').AdMobInterstitial;
},
},
get() {
deprecatedModule(
`import { AdMobRewarded } from 'expo' -> import { AdMobRewarded } from 'expo-ads-admob'`,
'expo-ads-admob'
);
return require('expo-ads-admob').AdMobRewarded;
},
},