Software Archive
Read-only legacy content
17061 Discussions

Admob plugin

Jack_p_1
Beginner
605 Views

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

0 Kudos
6 Replies
Jack_p_1
Beginner
605 Views

Please help me :(

0 Kudos
Hamilton_Tenório_da_
Valued Contributor I
605 Views

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

0 Kudos
Jack_p_1
Beginner
605 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
Hamilton_Tenório_da_
Valued Contributor I
605 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
Jack_p_1
Beginner
605 Views

Thank you :D

0 Kudos
PaulF_IntelCorp
Employee
605 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
Reply