aliokan / cordova-plugin-admob

AdMob Phonegap Plugin for Android and iOS
MIT License
71 stars 43 forks source link

Can't display ad on iOS #20

Open thibka opened 10 years ago

thibka commented 10 years ago

Hey, here is my code. It works nicely on Android but it doesn't work on iOS. In the Xcode emulator I have a white empty banner, on an iPhone 3 device, nothing happens at all.

var admob_ios_key = 'ca-app-pub-6068517762438360/4083177731';
var admob_android_key = 'ca-app-pub-6068517762438360/7720118534';
var adId = (navigator.userAgent.indexOf('Android') >=0) ? admob_android_key : admob_ios_key;

admob.createBannerView(
     {
       'publisherId': adId,
       'adSize': admob.AD_SIZE.BANNER
     },
     function(){
          admob.requestAd(
          {
          'isTesting': false,
          'extras': {
          'color_bg': 'AAAAFF',
          'color_bg_top': 'FFFFFF',
          'color_border': 'FFFFFF',
          'color_link': '000080',
          'color_text': '808080',
          'color_url': '008000'
          },
          },
          function(){

          },
          function(){
            alert("request error");
          }
          );
     },
     function(){
      alert("create error")
     }
      );

Any idea what's going on ?

thibka commented 10 years ago

It finally worked. Didn't change anything, I haven't got a clue what happened.