Admob is not displayed during the app's first execution. 2

后端 未结 2 1558
忘掉有多难
忘掉有多难 2021-01-16 23:47

I made an Android app with Phonegap (Cordova 2.5.0). And I put admob in my app using this plugin. ( https://github.com/sainttex/PhoneGap-Android-Native-AdMob )

Admob

相关标签:
2条回答
  • 2021-01-17 00:16

    You should do this after the super.loadUrl("------");

    adView = new AdView(this, AdSize.BANNER, AdMob_Ad_Unit); 
            LinearLayout layout = super.root;
            layout.addView(adView); 
            AdRequest request = new AdRequest();
            adView.loadAd(request);
    
    0 讨论(0)
  • 2021-01-17 00:25

    Install cordova admob plugin.

    cordova plugin add com.admob.AdmobPlugin
    

    Then add this code.

    function onDeviceReady() {  
        admobAd.initBanner("ca-app-pub-1738093038576474/9839543541",admobAd.AD_SIZE.BANNER.width,admobAd.AD_SIZE.BANNER.height);//ios Interstitial  
        admobAd.showBanner(admobAd.AD_POSITION.BOTTOM_CENTER);  
    }  
    document.addEventListener('deviceready',onDeviceReady, false); 
    
    0 讨论(0)
提交回复
热议问题