This is a migrated thread and some comments may be shown as answers.

Admob Position

4 Answers 61 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
HSLaw
Top achievements
Rank 1
HSLaw asked on 25 Nov 2014, 08:12 AM
Hi,

Now I'm able to show Admob on top/bottom of the view.

How can I show an ads in the view? E.g. between the header and the content or between the footer and the content?

Thanks.

4 Answers, 1 is accepted

Sort by
0
Zdravko
Telerik team
answered on 27 Nov 2014, 08:53 AM
Hi,

I am not sure whether you can choose a different position of the ads except top/bottom and the whole screen on in the face of interstitial ad, but you will have to check the settings of the plugin you are using in your app. Maybe there is a plugin that could allow such modifications.

Maybe you will find interesting the Ad placement policy of Google on the matter.

As a side note, I would like to kindly ask you to consider renewing your license in order to benefit from AppBuilder support service.

Regards,
Zdravko
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
XiMnet Malaysia
Top achievements
Rank 1
answered on 27 Nov 2014, 09:31 AM
Hi Zdravko,

I'm the thread starter replying with our license's account.
I noticed the code for interstitial ad is commented in the sample code.
Is it supported yet?
When I try the code there is no ads displayed.

Below is the snippets:

,
 
    fn_show_interstitial_view: function () {
         
          alert("interstitial");
         
        if (this.fn_check_simulator()) {
            return;
        }
 
        var admob_ios_key = app_config.admob_interstitial_ios_key;
        var admob_android_key = app_config.admob_interstitial_android_key;
        // var admob_wp8_key = 'ca-app-pub-9517346003011652/2695027726'; // future work
 
        var adMobKey = (navigator.userAgent.indexOf('Android') >= 0) ? admob_android_key : admob_ios_key;
 
          alert(adMobKey);
         
        window.plugins.AdMob.createInterstitialView(
            // createInterstitialView params
            {
                'publisherId': adMobKey
            },
            // createInterstitialView success callback
            function () {
                window.plugins.AdMob.requestInterstitialAd(
                    // requestInterstitialAd  params
                    { 'isTesting': false },
                    // requestInterstitialAd  success callback
                    function () {
                         
                      window.plugins.AdMob.showAd(
                          // showAd params
                          true,
                          // showAd success callback
                          function() {alert('show ok')},
                          // showAd error callback
                          function() { alert('failed to show ad')});
                           
                    },
                    // requestInterstitialAd  error callback
                    function () { alert('failed to request ad'); }
                );
            },
            // createInterstitialView error callback
            function () { alert('failed to create banner view'); }
        );
    },

Thanks.
0
Zdravko
Telerik team
answered on 01 Dec 2014, 01:37 PM
Hello,

I guess you are talking about the app from our plugins marketplace. If this is the case you will notice in the About section there a note explaining that fullscreen banners are unavailable in the current version.

However, I was able to show interstitial ad using this plugin. To do that on your side you will have to export the plugins from the Plugins folder of my sample app attached in this thread and import them in your app. I made a few changes to the plugins because we still don't support dependencies like the one from below and one of the plugins used such.

<dependency id="com.google.playservices@19.0.0"/>

Furthermore, you will have to register interstitial ad unit in your AdMob console and provide it in the initAd() function.

If you need any further assistance I will be glad to help.

Regards,
Zdravko
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
XiMnet Malaysia
Top achievements
Rank 1
answered on 02 Dec 2014, 01:49 AM
Thanks, Zdravko.

Tags
General Discussion
Asked by
HSLaw
Top achievements
Rank 1
Answers by
Zdravko
Telerik team
XiMnet Malaysia
Top achievements
Rank 1
Share this question
or