admin管理员组文章数量:1289857
I have some issue and I have been struggling with this problem for a long time...
My code:
<button class="sem-show-ad">Show ad</button>
<script src="cordova.js"></script>
<script>
document.addEventListener('deviceready', () => {
window.admob.start();
});
let interstitial
document.addEventListener('deviceready', () => {
alert(window.admob);
document.querySelector(".sem-show-ad").addEventListener("click", async () => {
console.log("window.admob:", window.admob);
interstitial = new window.admob.InterstitialAd({
adUnitId: 'ca-app-pub-3940256099942544/1033173712', // test
});
interstitial.on('load', (evt) => {
console.log("c: ", evt.ad);
});
console.log("interstitial: ",interstitial);
await interstitial.load();
await interstitial.show();
interstitial.on('loadFail', (err) => {
console.error("Failed to load ad:", err);
});
interstitial.on('showFail', (err) => {
console.error("Failed to show ad:", err);
});
});
}, false);
document.addEventListener('admob.ad.dismiss', async () => {
// Once a interstitial ad is shown, it cannot be shown again.
// Starts loading the next interstitial ad as soon as it is dismissed.
await interstitial.load()
})
</script>
I can't show interstitial ad, I have no Idea why, I asked chat GPT but it didn't help me... I was based on documentation:
I have tried to debug in many ways, for example connecting my mobile device to my computer and debugging through the chrome console, but I do not get any errors
Before I used admob-plus-cordova 1.28.0 and everything worked, but I got a message from google play console that I have to update my plugins:
com.google.android.gms:play-services-ads-lite:20.6.0 The creator of the Google Mobile Ads (GMA) SDK package (com.google.android.gms:play-services-ads-lite) added this notice to version 20.6.0:
As of June 30th 2024, this version is sunset. For more information, please visit .
From May 20, 2025, at 00:00 (UTC), it will no longer be possible to publish new versions of applications containing this version of the SDK package on the production track or the open testing track.
本文标签: javascriptProblem with interstitial in admobpluscordova 200alpha19Stack Overflow
版权声明:本文标题:javascript - Problem with interstitial in admob-plus-cordova 2.0.0-alpha.19 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741410257a2377189.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论