Software Archive
Read-only legacy content
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

Admob plugin

Jack_p_1
Beginner
108 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
108 Views

Please help me :(

Hamilton_Tenório_da_
Valued Contributor I
108 Views

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

Jack_p_1
Beginner
108 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

Hamilton_Tenório_da_
Valued Contributor I
108 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 
    });

 

Jack_p_1
Beginner
108 Views

Thank you :D

PaulF_IntelCorp
Employee
108 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.

Reply