Software Archive
Read-only legacy content
17061 Discussions

app not showing admob ads

wahdat_k_
Beginner
226 Views

i tried to integrate admob in my app but the app is not showing ads this is the code....

 var admobid = {};
                        if( /(android)/i.test(navigator.userAgent) ) {
                            admobid = { // for Android
                                 banner: 'ca-app-pub-xxxxxxxxxxx/xxxxxxxxxx',
                            };
                            } else if(/(ipod|iphone|ipad)/i.test(navigator.userAgent)) {
                                admobid = { // for iOS
                                banner: 'your iOS admob ad unit id'
                            };
                            } else {
                                admobid = { // for Windows Phone
                                banner: 'your windows phone admob ad unit id'
                            };
                        }
                        //
                        function initApp() {
                            if (AdMob) {
                                AdMob.createBanner({
                                adId : admobid.banner,
                                position : AdMob.AD_POSITION.BOTTOM_CENTER,
                                autoShow : true
                                });
                            }
                        }

 

0 Kudos
1 Reply
PaulF_IntelCorp
Employee
226 Views

Sorry, but we are not experts on the many hundreds of third-party plugins that are available for use with Cordova apps. I recommend you check for some example code in the respective AdMob repo or check Stack Overflow for posts by other Cordova (aka PhoneGap) developers who have also experienced issues with the AdMob plugin you are using (there are many such plugins out there). For example, searching SO for something like "admob plugin cordova phonegap" should give you a good list of issues to check.

0 Kudos
Reply