Closed Script47 closed 7 years ago
Are you calling admob.interstitial.show()
immediately? Please have a look on the example,
see if you code has any difference.
@ratson Is there an event for me to use to check if the ad is ready?
In my code, I'm not immediately calling it, it only runs if a condition is met which happens later on in the app.
@Script47 In current version you could simply use:
admob.interstitial.prepare();
document.addEventListener('admob.interstitial.events.LOAD', function(event) {
admob.interstitial.show();
})
In the next release you will be able to prepare the interstitial and checks if it's ready on-demand using admob.interstitial.isReady().then(isReady => console.log("Am I ready?", isReady))
.
Also check the docs https://ratson.github.io/cordova-plugin-admob-free/variable/index.html#static-variable-interstitial and examples pointed out by ratson.
@vintage @ratson Odd... I have all the events, but no errors are showing at all, neither is the ad, the is as you can see below, one other thing is that I don't actually have access to the console hence I used the error event, but still nothing shows.
admob.interstitial.prepare()
document.addEventListener('admob.interstitial.events.LOAD_FAIL', function (e) {
swal({
'title': 'Admob Error',
'html': e,
'type': 'error'
});
});
/** interstitial has loaded successfully **/
document.addEventListener('admob.interstitial.events.LOAD', function () {
admob.interstitial.show();
});
/** On interstitial close, reprepare. **/
document.addEventListener('admob.interstitial.events.CLOSE', function () {
admob.interstitial.prepare()
});
@ratson @vintage
Bump - Still not working, any ideas?
@Script47
Does this one works for you?
admob.interstitial.config({
id: <PUT_YOUR_ID>,
isTesting: true,
autoShow: true
});
admob.prepare();
If not, what errors shows on the browser console or xcode/adb console?
Update
For those of you who (like me) were struggling to get this to work using Intel XDK should note that you use use deviceready
instead of the app.Ready
function, this was causing the plugin not to work for me.
Since the update, my ads won't show for some reason, my code is as shown below.
Any ideas?