Skip to content
This repository was archived by the owner on Jun 27, 2020. It is now read-only.

Latest commit

 

History

History
71 lines (61 loc) · 1.75 KB

BREAKING.md

File metadata and controls

71 lines (61 loc) · 1.75 KB

Breaking Changes

0.2.13

  • isTest: 'LIVE' | 'TESTING' => boolean

0.2.12

app.component.ts

    import { Plugins } from '@capacitor/core';
    
    const { AdMob } = Plugins;
    
    @Component({
      selector: 'app-root',
      templateUrl: 'app.component.html',
      styleUrls: ['app.component.scss']
    })
    export class AppComponent {
        constructor(){
            // Initialize AdMob for your Application
+           AdMob.initialize('[APP_ID]');
-           AdMob.initialize();
        }
    }

admob.component.ts

    import { Plugins } from '@capacitor/core';
    import { AdOptions, AdSize, AdPosition } from '@rdlabo/capacitor-admob';
    
    const { AdMob } = Plugins;
    
    @Component({
      selector: 'admob',
      templateUrl: 'admob.component.html',
      styleUrls: ['admob.component.scss']
    })
    export class AdMobComponent {
    
        const options: AdOptions = {
            adId: 'YOUR ADID',
            adSize: AdSize.BANNER,
            position: AdPosition.BOTTOM_CENTER,
-           margin: '0',
+           margin: 0,
        }
    
        constructor(){
            // Show Banner Ad
            AdMob.showBanner(this.options)
            .then(
                (value) => {
                    console.log(value);  // true
                },
                (error) => {
                    console.error(error); // show error
                }
            );
    
            // Subscibe Banner Event Listener
            AdMob.addListener('onAdLoaded', (info: boolean) => {
                 console.log("Banner Ad Loaded");
            });
    
+           // Get Banner Size
+           AdMob.addListener('onAdSize', (info: boolean) => {
+                console.log(info);
+           });
        }
    }