Giter Site home page Giter Site logo

Comments (9)

floatinghotpot avatar floatinghotpot commented on July 26, 2024

did you add the plugin and call the plugin after 'deviceready' event?

from cordova-plugin-iad.

codyhawke avatar codyhawke commented on July 26, 2024

I'm using phonegap build - looks like my code tag didn't send with my first message. here it is what is in my config.xml, minus the brackets:
gap:plugin name="com.rjfun.cordova.plugin.iad" version="0.1.7"

  • and i'm calling createBanner long after deviceReady, it's only used long after the start of the app when you hit a button, so I'm sure the device itself is ready. Is there some additional code I need to initialize the plugin before I call iAd.createBanner?
    Also - thanks for the speedy response!

from cordova-plugin-iad.

floatinghotpot avatar floatinghotpot commented on July 26, 2024

now i understand the root cause. you are using the plugin i submitted to phonegap build months ago, but the doc and plugin in github.com is totoally re-written and they does not match. will fix it when i have time.

from cordova-plugin-iad.

floatinghotpot avatar floatinghotpot commented on July 26, 2024

rollback to original version to keep it compatible.

re-written pro version move to repo:
https://github.com/floatinghotpot/cordova-iad-pro

from cordova-plugin-iad.

codyhawke avatar codyhawke commented on July 26, 2024

Thank you for addressing this so quickly. So, do I need to change something within my phonegap build settings to get it back working? Or do they need to release the new version on phonegap build first?

from cordova-plugin-iad.

floatinghotpot avatar floatinghotpot commented on July 26, 2024

the README in this repo has been rolled back and compatible with the plugin in phonegap build.

follow the code here:
https://github.com/floatinghotpot/cordova-plugin-iad

from cordova-plugin-iad.

codyhawke avatar codyhawke commented on July 26, 2024

That did the trick. Ads are showing now. However - I'm seting a timeout after the ad is shown to hide it afterwards, and although it disappears, it seems to come back within a few minutes. Am I hiding the ad properly? Do they reopen up after time? I'm mainly wondering if I'm doing the right thing by trying to hide the existing ad by using the line: window.plugins.iAd.showAd( false );.
Full code of the relevant section is as follows:
try{
if(adLoaded==false){
adLoaded=true;

    if(window.plugins && window.plugins.iAd) {
        window.plugins.iAd.createBannerView({
                    'bannerAtTop': false,
                    'overlap': false,
                    'offsetTopBar' : false
                }, function() {
                    window.plugins.iAd.showAd( true );
                }, function(){
                });

setTimeout(function(){
if ( window.plugins && window.plugins.iAd ) {
window.plugins.iAd.showAd( false );
}

}, 10000);
}
}
}catch(ex){
alert(ex.toString());
}
Thanks so much for the quick support.

from cordova-plugin-iad.

codyhawke avatar codyhawke commented on July 26, 2024

As a sidenote, it seems that the command
window.plugins.iAd.showAd(false);
might be causing the ads to show. Is this the recommended way to hide the ad?
Thanks,
Cody

from cordova-plugin-iad.

floatinghotpot avatar floatinghotpot commented on July 26, 2024

Notice

This plugin will not be updated any more.

Please use the pro version instead, which is much better and supports both banner and interstitial iAd.

from cordova-plugin-iad.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.