purplecabbage / phonegap-plugins

Plugins for use with PhoneGap.
972 stars 3.82k forks source link

Show atbottom #14

Closed alg closed 12 years ago

alg commented 13 years ago

Hi guys,

I just updated the code of iAd plugin a bit to support the simplified calling, like showAd(true, true) (where the second parameter is atBottom).

It's very convenient when you have multiple pages where you want your ads shown and hidden. When moving between those pages I just call showAd(true, true) and showAd(false) as appropriate. It won't display the Ad if it's not loaded yet. The plugin will still fire callbacks on success and failure and then showAd(true / false) can be called to show / hide the Ad. This change makes it a one-step shop for showing / hiding Ads without making an extra prepare() call.

I was also thinking of automating it a bit and show the ad after initial loading automatically (and hide it on failure), leaving the callback to something else the app needs to do since showing / hiding is necessary pretty much every time. Does it make sense?

Also, pardon me, but I cleaned up the code base a bit (where our roads crossed basically). In fact, Xcode 4 made most of whitespace changes.

Cheers!

(Sorry for the previous -- closed -- pull request. It was for the wrong branch and also didn't include one important commit.)

purplecabbage commented 12 years ago

Please update and resubmit. This may have been merged via the phonegap fork.

alg commented 12 years ago

Thanks, but no thanks. It's a year old request, and I'm not sure I want to get back to it to wait another year.