cordova-plugin-admob-free
cordova-plugin-admob-free copied to clipboard
invalid action
hello, i am getting invalid action error whenever i try to display banners on android emulator. interstitials work perfectly and also on ios emulator.
admob.banner.config({ id: 'ca-app-pubxxxxxxxx', isTesting: true, autoShow: true, bannerAtTop: false })
// Create banner
admob.banner.prepare()
+1
Sometimes this happens because of newly created adspace in AdMob. Once adspace starts severing ads after 2-3 hours then it should start working, check with AdMob test ids.
@mugenyi Do you get it working now?
Hi @ratson,
I'm getting the same issue as well..
admobFree.banner.config({ id: '...', isTesting: true, autoShow: true });
admobFree.banner.prepare();
Unhandled Promise rejection: Invalid action ; Zone: <root> ; Task: Promise.then ; Value: Invalid action
polyfills.js:3 Error: Uncaught (in promise): Invalid action
at g (polyfills.js:3)
at l (polyfills.js:3)
at polyfills.js:3
at Object.callbackFromNative (cordova.js:295)
at processMessage (cordova.js:1119)
at processMessages (cordova.js:1142)
at t.invoke (polyfills.js:3)
at n.run (polyfills.js:3)
at polyfills.js:3
at t.invokeTask (polyfills.js:3)
at n.runTask (polyfills.js:3)
at a (polyfills.js:3)
This happens whether I use test IDs or live ad IDs..
Can you please advise how to resolve this?
i am also same error ERROR Error: Uncaught (in promise): Invalid action at c (polyfills.js:3) at polyfills.js:3 at Object.callbackFromNative (cordova.js:295) at processMessage (cordova.js:1119) at processMessages (cordova.js:1142) at t.invoke (polyfills.js:3) at Object.onInvoke (main.js:3) at t.invoke (polyfills.js:3) at r.run (polyfills.js:3) at polyfills.js:3
const bannerConfig: AdMobFreeBannerConfig = { isTesting:true, autoShow: true };
console.log(bannerConfig);
this.admobFree.banner.config(bannerConfig);
this.admobFree.banner.prepare()
.then(() => {
console.log("banner load page");
// banner Ad is ready
// if we set autoShow to false, then we will need to call the show method here
})
.catch(e => console.log(e));
yes getting this as well. With test and live ids. This happens with both banner and interstitials.
@ratson
This happens when newer versions of cordova-android version is above 6.2.3.
Adding platform as ionic cordova plaform add [email protected]
works.
Did anyone figure this out with newer android version?
Also facing the same problem.
Has anyone been able to find a solution to this problem, because none of the solutions above seem to work for me. Anybody?
It doesn't effect anything. If It is an alertbox just set window.alert = function (){} like this, to an empty function. If it is a runtime error just try catch, if it is an compiler error use //@ts-ignore comment.
Of course it is just a temporary solution.
For anyone stumbling on this issue, double check you're using a test ad ID and not an actual one.