Cordova iAd Plugin
by Shazron Abdullah
Adding the Plugin to your project
Using this plugin requires Cordova and iAd. iAd requires at least the iOS 4 SDK.
- Make sure your Cordova Xcode project has been updated for Cordova 1.6.0
- Add the "iAd" framework to your Frameworks folder, and set it to be weak linked (see "Weak Linking the iAd Framework" section below)
- Add the .h and .m files to your Plugins folder in your project (as a Group "yellow folder" not a Reference "blue folder")
- Add the .js files to your "www" folder on disk, and add reference(s) to the .js files as <script> tags in your html file(s)
- Make sure you check the "RELEASE NOTES" section below!
- Your App must be added to https://iad.apple.com/itcportal/ to make $
Weak Linking the iAd Framework
- In your project, under "Targets", double click on the Target item
- Go to the "General" Tab, under "Linked Libraries"
- For the iAd Framework, change the value from "Required" to "Weak"
- Landscape mode iAds
- Showing of other ad network ads in place of iAds, if no iAds are available
- Cordova 3.0.0 support (@LimingXie)
- Changed license to Apache 2.0 License
- Updated for Cordova 1.6.0 (backwards compatible to earlier versions as well)
- wrapped object in function closure (to prevent pollution of the global namespace)
- Cordova 1.5.0 support (@RandyMcMillan)
- Initial release
- Only supports portrait iAd banners
- Not tested on a 3.x device
- WebView initial size being oversized is a PhoneGap Core issue, and is not addressed in this plugin. When an ad is shown, it correctly sizes the WebView, and when the ad is hidden, sets the WebView back to its original size.
- Not tested with any other native UI plugins, like TabBar, and will not play nice with them (until we get a better layout management system/plugin)
- Requires PhoneGap 0.9.6
- Fixed size issues
- Orientation change handling
- Works on iPad 4.x
- Still does not play nice with other native UI plugins like TabBar (yet)
BUGS AND CONTRIBUTIONS
Patches welcome! Send a pull request. Since this is not a part of Cordova Core (which requires an Apache iCLA), this should be easier.
Post issues in the PhoneGap Google Groups, include in the subject heading - "AdPlugin" or on Github
Copyright 2012 Shazron Abdullah
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.