ratson / cordova-plugin-admob-free

New development has been moved to "admob-plus-cordova", https://github.com/admob-plus/admob-plus/tree/master/packages/cordova
https://github.com/admob-plus/admob-plus
MIT License
499 stars 214 forks source link

invalid action #61

Open mugenyi opened 7 years ago

mugenyi commented 7 years ago

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()

cleandersonlobo commented 7 years ago

+1

geekyguy18 commented 7 years ago

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.

ratson commented 7 years ago

@mugenyi Do you get it working now?

awe-sim commented 7 years ago

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?

startappsolution commented 6 years ago

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

startappsolution commented 6 years ago

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));
prantikv commented 6 years ago

yes getting this as well. With test and live ids. This happens with both banner and interstitials.

prantikv commented 6 years ago

@ratson

This happens when newer versions of cordova-android version is above 6.2.3.

Adding platform as ionic cordova plaform add android@6.2.3 works.

carliblaz commented 5 years ago

Did anyone figure this out with newer android version?

AhSem commented 5 years ago

Also facing the same problem.

gastonche commented 5 years ago

Has anyone been able to find a solution to this problem, because none of the solutions above seem to work for me. Anybody?

theomgdev commented 4 years ago

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.

h3 commented 3 years ago

For anyone stumbling on this issue, double check you're using a test ad ID and not an actual one.