svmszcck
svmszcck

Reputation: 1

Cordova - Admob cordova plugin error, black & blank ads

Helo. I am using Admob cordova plugin to display ads in my ionic based app. However i am getting black blank banner and in android logcat i am getting this error: JS: Uncaught ReferenceError: AFMA_ReceiveMessage is not defined I googled and stackowerflowed it but couldn't find a solution. What can i do? I am sugin the plugin as it is explained in git repo. I think the problem is about sdk. Thanks.

my ionic ready code part looks like this:

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if (window.cordova && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
      cordova.plugins.Keyboard.disableScroll(true);

    }
    if (window.StatusBar) {
      // org.apache.cordova.statusbar required
      StatusBar.styleDefault();
    }

     window.plugins.AdMob.setOptions( {
          publisherId: 'ca-app-pub-*****/*****',
          bannerAtTop: false, // set to true, to put banner at top
          overlap: false, // set to true, to allow banner overlap webview
          offsetTopBar: false, // set to true to avoid ios7 status bar overlap
          isTesting: false, // receiving test ad
          autoShow: true // auto show interstitial ad when loaded
        });
        // display the banner at startup
        window.plugins.AdMob.createBannerView();

  });

******EDIT*******

After a couple of app starts now i am getting this error in logcat and still black & blank banner ad.

"Receiver error Http response code: 403 "
"There was a problem getting an ad response. ErrorCode: 0 "
"Failed to load ad: 0"

https://i.sstatic.net/g8wQA.png
https://i.sstatic.net/2E4Q1.png

****** Final Edit *********

Finally i can see test ads in my app. I think if you use admob plugin wihtout test mode admob is blocking your id. I am gonna update app on play store with production mode. I will write the result


Upvotes: 0

Views: 849

Answers (1)

Amod Gokhale
Amod Gokhale

Reputation: 2448

The 403 Forbidden error is an HTTP status code which means that accessing the page or resource you were trying to reach is absolutely forbidden for some reason.

i. Try to switch from Wifi to Data or vice versa.

ii. Check if correct AdmobID is used

iii. check if you have installed any Ad blocking applications.

iV. If all above are correct, check if you have recieved any email from admob for account related information?

Upvotes: 0

Related Questions