Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
28 Views

Admob plugin

Hello, since they changed the new version it is a headache and I'm more lost.
Try search plugins "Admob Plugin" and can not find it and
Thirds-party puts me npm
Does anyone know how to fix this? I have the latest version

Then simulate, Android works for me perfect, but I get IOS black screen ...

Thank you

Tags (2)
0 Kudos
6 Replies
Highlighted
Beginner
28 Views

Please help me :(

0 Kudos
Highlighted
Valued Contributor I
28 Views

Use AdMob Plugin Pro (cordova-plugin-admobpro). It works!

0 Kudos
Highlighted
Beginner
28 Views

Hamilton Tenório da Silva wrote:

Use AdMob Plugin Pro (cordova-plugin-admobpro). It works!

It is included in the program itself or do I have to download and then import it?
Before it was super easy, now they changed and I despair

0 Kudos
Highlighted
Valued Contributor I
28 Views

You must include this plugin and insert some information in your code.

The old admob.js must be removed from your project.

In my code I put this:

//mostra banner
    var admobid = {};
    // select the right Ad Id according to platform
    if( /(android)/i.test(navigator.userAgent) ) { 
        admobid = { // for Android
            banner: 'ca-app-pub-xxxx',
            interstitial: ''
        };
    } else if(/(ipod|iphone|ipad)/i.test(navigator.userAgent)) {
        admobid = { // for iOS
            banner: 'ca-app-pub-yyyy',
            interstitial: ''
        };
    } else {
        admobid = { // for Windows Phone
            banner: '',
            interstitial: ''
        };
    }        
    if(AdMob) AdMob.createBanner({
        adId: admobid.banner,
        position: AdMob.AD_POSITION.BOTTOM_CENTER,
        autoShow: true 
    });

 

0 Kudos
Highlighted
Beginner
28 Views

Thank you :D

0 Kudos
Highlighted
28 Views

Jack -- use the "add third-party plugin" option under the plugin management tool and use "NPM" as your plugin add option, using the plugin name that Hamilton provided.

0 Kudos