Giter VIP home page Giter VIP logo

cordova-plugin-iad's Introduction

cordova-plugin-iad


Present Apple iAd in Mobile App/Games natively from JavaScript.

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.

See Also

Cordova/PhoneGap plugins for the world leading Mobile Ad services:

More Cordova/PhoneGap plugins by Raymond Xie, click here.

Project outsourcing and consulting service is also available. Please contact us if you have the business needs.

cordova-plugin-iad's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-plugin-iad's Issues

Not working in Phonegap 2.4

I have followed all the steps but i am not getting any ads on my application.
I have put alert on var argscheck = require('cordova/argscheck'), exec = require('cordova/exec'); to check but i am not getting any alert after the above mentioned code. And its not going in file iad.js file.
I have added in my config.xml file.
Help me getting iAds on my application.

Thanks in advance for help.

Does not detect landscape orientation when the device is lying flat

I don't think you can use this to detect landscape orientation:

UIDeviceOrientation currentOrientation = [[UIDevice currentDevice] orientation];
if( UIInterfaceOrientationIsLandscape( currentOrientation ) ) {
    ...
}

Because it won't work if the device is lying flat on the table. Another way to detect landscape orientation, is to just check whereabouts the status bar is. E.g.

- (bool)__isLandscape {
    bool landscape = NO;

    UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
    switch (orientation) {
        case UIInterfaceOrientationPortrait:
        case UIInterfaceOrientationPortraitUpsideDown:
            landscape = NO;
            break;
        case UIInterfaceOrientationLandscapeLeft:
        case UIInterfaceOrientationLandscapeRight:
            landscape = YES;
            break;
        default:
            landscape = YES;
            break;
    }

    return landscape;
}

That works pretty well - except when the status bar is hidden. For me, that's a better solution, because it works pretty much 100% of the time for my app, even when the device is lying flat.

Blank Banner view

Is the Serie just with me?? I prepare the ad the there is for about 1 or 2 seconds a black Banner. Then the ad is shown. But sometimes the iad Part stays black :(

Is there a way that the webview Not gets smaller if there is no ad to Show?

Not working

Hey,
Thx for the phonegap build option!
for some reason it isnt working.
When i open the page it alerts "a" and not getting into the "onDeviceReady"
My app is built this way:
Main page->choose level
and for testing ive tested the code on "choose level"
this is the code:
http://codepen.io/anon/pen/lBcyI
(Yes, im running it on the iPhone)

Thx for help.
*Im running iOS8 Beta 5

Problem with iOS6 statusbar

Hi, in iOS6 after loading iAD plugin (phonegap build) a white 20px area appears under statusbar. It seems like overlay statusbar in iOS7.
Am I clear?

IAD/AdMob/Flurry precedence and priority. (fallback solutions)

Hello, Great plugins by the way! I am trying to implement a solution in which

  1. For ios you can fallback on AdMob if IAD doesnt fill, and if Admob doesnt fill you can fallback on flurry (using all 3).
  2. For android you would use AdMob as a primary, but fallback on Flurry if Admob isnt filled.

My question is what is the best practice for implementing this? I have tried hiding/showing based on the recieveAd and fail to recieve ad events but the behavior is inconsistent. For example, when IAD ads were available again, calling show(true) would not replace the Admob or Flurry ad although I could see successful receive events being fired.

Any idea on how you could accomplish this for this plugin?

Thanks

Compiling with PhoneGap build

Hello,

How will this work with PhoneGap build? I followed the tutorial but when I compiled my app for iOS, it started up and said that the iAd plugin was not available. I'm guessing this has something to do with weak linking the iAd framework?

Orientation changes don't work

An orientation change on the device causes a "selector not found" exception, presumably because there is no "deviceOrientationChange" method in your code.

I added such a method in myself, and it works OK now:

- (void)deviceOrientationChange:(NSNotification *)notification{
    UIDeviceOrientation currentOrientation = [[UIDevice currentDevice] orientation];
    Class adBannerViewClass = NSClassFromString(@"ADBannerView");
    if (adBannerViewClass && self.adView) {

        if( UIInterfaceOrientationIsLandscape( currentOrientation ) ) {
            self.isLandscape = YES;
            self.adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;
        } else {
            self.isLandscape = NO;
            self.adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
        }

        [self resizeViews];
    }
}

I would send a pull request, except I don't really get what the "willRotateToInterfaceOrientation" method is for then, and whether what I did was even right. (I don't know that much about Objective-C)

cheers,
-adam

writeJavascript deprecated

Hi,

Thanks for a great plugin!

I am however experiencing an issues Im hoping to get some help with. When I use "showAd(true)" and "showAd(false)" it all works as intended, but, sometimes, with no user-interaction the iAd just decides to show up. Following can then be seen in the log:

2014-12-16 21:35:23.592 Banner failed to load Ad
2014-12-16 21:35:24.798 Banner Ad loaded
2014-12-16 21:35:24.798 CDViAd Show Ad: 1
2014-12-16 21:35:24.803 banner visible

Could it maybe be related to the following Depcrecation Warnings in Xcode?

"'writeJavascript:' is deprecated: Deprecated in Cordova 3.6. Use the CDVCommandDelegate equivalent of evalJs:. This will be removed in 4.0.0"

I assume its the same issue as in https://github.com/floatinghotpot/cordova-plugin-admob/issues/169

Any help/tips would be appreciated!

Thanks!

Probleme in landscape

Hello, I have a problem with your plugin,

When I'm in portrait everything works, but when I switch to landscape the application if poster 320px wide and a whitespace appears on the rest of the screen, I'm under ios8 beta 5 and cordova 3.5.0
Sorry I speak very well English
THX
In portrait :
img_0500

In landscape :

img_0501

Rotating while ad open breaks view

While testing out this plugin (both 0.1.1 and 0.1.2), I noticed that if the user opens an ad, rotates the device, then closes the ad, then the webview dimensions get messed up.

I've attached a screenshot of the demo app (with the background set to blue) to show this issue.
photo 1

Orientation change despite UIInterfaceOrientationPortrait

Fantastic plug-in and looking forward to today's "iPad lying flat" update making it to PhoneGap build soon.

One quick issue - now you can force orientation via UIInterfaceOrientationPortrait in Build the plug-in still catches the orientation change and resizes/repositions giving an odd, unwanted result.

Crashes on any orientation change with PhoneGap Build

I tried this plugin with PhoneGap Build and was able to get the sample ads to serve. However, the app crashes on any physical orientation change of the device (e.g. portrait -> landscape, flat -> vertical). The ads serve correctly regardless of the orientation when the app is opened, but the first physical orientation change will crash the app immediately.

To clarify, the app is not designed to do anything when the orientation changes. It just remains fixed in portrait. However, the physical movement seems to crash it with this plugin.

So far I have reproduced this bug with PhoneGap 3.0.0 and 3.1.1. Also, I have tested with the config.xml orientation set to both "default" and "portrait."

I don't have the Objective-C for the plugin locally because I'm using PhoneGap Build. Are there any options for me to diagnose or fix this?

Events not working

Hi!

Trying to implement this really great plugin but it seems the events are not working.

For instance adding this code does not cause an alert when a banner is clicked.
function onClickAd() {
// count click
alert('iAd click');

}

Is this an issue with the plugin or is it possible I am doing something wrong.

I am using the Phonegap Build service.

Many thanks!

Ed.

Events failing

The events, like iAdBannerViewDidFailToReceiveAdWithErrorEvent are not being received by the plugin.

@rjbrunee posted a code hack in here: https://github.com/rjbruneel/cordova-plugin-iad/blob/master/test/index.html, using a timeout longer than prepare to show the ads, instead of the event listeners. It works, but it is not a real solution.

I needed the events because I was trying to fill the gaps, in countries where iAds doesn't has adds to show, with ads from admob.

Thanks.

(http://code.tutsplus.com/tutorials/supplementing-iad-placement-with-admob--mobile-9543)

Ad pushing webview up

Any idea why this is happening?

image

Using Phonegap Build by the way.

Also when using this plugin, the app seems to crash sometimes on start up.

no ads showing?

I'm pretty sure it's something dumb I am missing - but I can't get even your hello world demo code to show any ads. I'm not getting any error messages and I have completed all the banking and tax sections in iTunes Connect and have an iAds contract in place.

Add support for landscape ads

Our app only operates in landscape so we need support for landscape ads. Since this functionality doesn't exist yet, we're happy to help add this functionality if someone could help provide some guidance on what we need to do. Thanks!

Hide iAd

Hello, i just add the banner, but i need to hide the iAd when i need it.
is it possible?

regards

Reference Error: Can't find variable iAd

Hi - I'm trying to get this plugin going on my phone app. When I try to create an ad, I get a JS reference error: Can't find variable iAd.
In my config.xml, I have:
<gap:plugin name="com.rjfun.cordova.plugin.iad" version="0.1.0" />
In my app, I have
if(iAd) {
iAd.createBanner( {
position:iAd.AD_POSITION.BOTTOM_CENTER,
autoShow:true
} );
}
Any idea what could be going on? Thanks.

wrong webview height

the line 153 in CDViAd.m wf.size.height = bf.origin.y; needs to be changed to wf.size.height = bf.origin.y - top;

Version issue in Phonegap Build

Hi,
It is a strange problem with iAd plugin in phonegap build. I don't use exact version while adding plugin in xml file, however after building app, it shows current version 0.1.3 and latest version 0.1.6. And if I write exact version (0.1.6) in xml file, it would show me error: plugin does not exist..
It means I still use old version (0.1.3)
Thanks..

How to add this plugin?

I added this plugin inside Phonegap Build:

Then on start of the app i call this function on deviceready:

iAdExport.createBannerView(options, successCallback, failureCallback);
iAdExport.showAd(show, successCallback, failureCallback);

options var is empty but it doesn't work either without options as parameter !? please help... this iAd thing is the last step before submitting my app...

when the app loads i get this error:
Error: 'undefined' is not an object (evaluating 'options[key]')

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.