cordova-plugin-admob icon indicating copy to clipboard operation
cordova-plugin-admob copied to clipboard

Banner and Interstitial ads do not work together

Open artgrape opened this issue 11 years ago • 10 comments

thanks for this great plugin! i got banner ads and interstitial ads working separately, however if i put both of them together interstateial will refresh banner, instead of load full screen ads. any suggestions would be greatly appreciated! thank you.

artgrape avatar Jan 25 '14 17:01 artgrape

same issue here pls help

satishgowda28 avatar Feb 13 '14 10:02 satishgowda28

also have the same issue, would be great if you could have both at once

mbretag avatar Feb 18 '14 13:02 mbretag

hi artgrape. how did you managed to make interstitial ads to work? because i can't see any ad on my phone.

adys123 avatar Apr 17 '14 14:04 adys123

hello i used exactly thte same example code the author provided. i am moving from mopub. they have a simpler interface.

On Thu, Apr 17, 2014 at 4:46 PM, adys123 [email protected] wrote:

hi artgrape. how did you managed to make interstitial ads to work? because i can't see any ad on my phone.

— Reply to this email directly or view it on GitHubhttps://github.com/aliokan/cordova-plugin-admob/issues/6#issuecomment-40721998 .

artgrape avatar Apr 19 '14 18:04 artgrape

do you mean this?

admob.createInterstitialView(
 {
   'publisherId': 'INSERT_YOUR_PUBLISHER_ID_HERE'
 },
 successCallback,
 failureCallback);

well..if a insert this one, do i need i trigger or something like that? i mean when a user click a link, an add will be shown?

adys123 avatar Apr 19 '14 20:04 adys123

sorry, won't be able to help more here, as i didn't wrote the code myself, i hired a developer to do it for me. and it didn't work at first, and i told him to look at the sample code, he did and it worked. perhaps the easiest is to just to build the sample project, get that work, then retro fit piece by piece into your own project. good luck!!

On Sat, Apr 19, 2014 at 10:13 PM, adys123 [email protected] wrote:

do you mean this?

admob.createInterstitialView( { 'publisherId': 'INSERT_YOUR_PUBLISHER_ID_HERE' }, successCallback, failureCallback);

well..if a insert this one, do i need i trigger or something like that? i mean when a user click a link, an add will be shown?

— Reply to this email directly or view it on GitHubhttps://github.com/aliokan/cordova-plugin-admob/issues/6#issuecomment-40879447 .

artgrape avatar Apr 23 '14 14:04 artgrape

Hello people, add these lines in executeRequestAd function in AdMobPlugin.java file for interstitial ads to work

            if (adView != null) 
            {
        requestAd(isTesting, inputExtras, callbackContext);
    }
    if (intertitial != null)
            {
        requestIntertitial(isTesting, inputExtras, callbackContext);
    }
    if(intertitial == null && adView == null)
    {
        callbackContext
                .error("adView && intertitial are null. Did you call createBannerView?");
        return;
    }

satishgowda28 avatar Apr 28 '14 08:04 satishgowda28

I got around this my killing the banner before opening an interstitial. then killing the interstitial and recreating the banner on onDismissScreen listener

ghost avatar May 14 '14 16:05 ghost

Hi, the code provided by the author isn't enough to make an interstitial. You need to requestAd in the success callback. I don't understand why the author doesn't correct the doc, it would save people a lot of time. Yet here it is :

var inter_ios_key = 'xxxxxx';
var inter_android_key = 'xxxxxx';
var interId = (navigator.userAgent.indexOf('Android') >=0) ? inter_android_key : inter_ios_key;

admob.createInterstitialView(
      {
        'publisherId': interId
      },
      function() { // success callback
        admob.requestAd(
          {
          'isTesting': false
          },
          function(){
             // success
          },
          function(){ // failure
            alert("request error");
          }
        );
      },
      function() { // failure callback
        alert('createInterstitial fail');
      }
    );

thibka avatar Jun 12 '14 11:06 thibka

i try today with Interstitial ads ,@Thibka code very helpful to me. and i know how to ad banner ads already . i combine both BANNER and Interstitial and its working perfectly.

umesh25 avatar Jul 22 '14 11:07 umesh25