0

I'm trying to add ads in my ng-nativescript app using nativescript-admob plugin.I'm following this guide.I've done everything right but my app is crashing everytime.
here is app.component.ts `

private androidBannerId: string = "ca-app-pub-kkkkkkkkk/tttttt";//replaced my own id
      public createBanner() {
          Admob.createBanner({
              testing: true,
              size: Admob.AD_SIZE.SMART_BANNER,
              androidBannerId: this.androidBannerId,
              margins: {
                  bottom: 0
              }
          }).then(function() {
              console.log("admob createBanner done");
          }, function(error) {
              console.log("admob createBanner error: " + error);
          });
      }
    
      public hideBanner() {
          Admob.hideBanner().then(function() {
              console.log("admob hideBanner done");
          }, function(error) {
              console.log("admob hideBanner error: " + error);
          });
      }

` I've updated AndroidManifest.xml as mentioned in guide post.also I'm using nativescript-firebase
plugin by eddy verbruggen.Please help me here.

  • I'm having the same issue and I found out, that just installing the plugin is enough to crash the emulator. I haven't changed my functioning code, only thing I did was `tns plugin add nativescript-admob` And app started crashing right away. – ndrjvvr Nov 21 '20 at 08:57
  • @ndrjvvr use AdMob features in the Firebase plugin instead of nativescript-admob if you r using firebase plugin . – Manish Bhatti Nov 21 '20 at 20:10

0 Answers0