Comments (9)
did you add the plugin and call the plugin after 'deviceready' event?
from cordova-plugin-iad.
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.
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.
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.
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.
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.
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.
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.
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.
- git repo: https://github.com/floatinghotpot/cordova-iad-pro
- plugin id:
com.rjfun.cordova.iad
from cordova-plugin-iad.
Related Issues (20)
- Orientation change despite UIInterfaceOrientationPortrait HOT 1
- Rotating while ad open breaks view HOT 1
- Compiling with PhoneGap build HOT 5
- Any plan to support interstitial ads? HOT 1
- Problem with iOS6 statusbar HOT 9
- Version issue in Phonegap Build HOT 1
- Not working HOT 4
- Probleme in landscape HOT 2
- Events not working HOT 3
- IAD/AdMob/Flurry precedence and priority. (fallback solutions) HOT 6
- no ads showing? HOT 2
- AdSupport.framework is not needed and should be removed from plugin.xml HOT 1
- wrong webview height HOT 1
- writeJavascript deprecated HOT 5
- Ad pushing webview up HOT 8
- Hide iAd HOT 9
- How's this plugin?
- Blank Banner view HOT 9
- Events failing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-iad.