Everything in my Phonegap Build app works, including the Google Analytics and FacebookConnect plugins. However, now I would like to add AdMob ads.
Phonegap Build does not provide a built-in plugin for AdMob, but according to the plugins page for building Phonegap, you can now add your own custom plugins (see the "Plugins for Contributing" section at the bottom of the page).
PhoneGap plugins can be made compatible with PhoneGap Build by using the plugin.xml file ...
The Phonegap build plugins page links to Child Browser plugins.xml on GitHub as an example of how to configure a custom plugin.xml file. The following is the contents of the Child Browser plugin.xml module.
I'm not sure which aspects of this file I need to change and what to change them. I think I have correctly configured the file structure of the Admob plugins for Phonegap for iOS and Android (see the file structure below), but I'm not sure how to refer to these files in the plugin.xml file correctly.
<?xml version="1.0" encoding="UTF-8"?> <plugin xmlns="http://www.phonegap.com/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="com.phonegap.plugins.childbrowser" version="3.0.4"> <name>Child Browser</name> <asset src="www/childbrowser.js" target="childbrowser.js" /> <asset src="www/childbrowser" target="childbrowser" /> <platform name="android"> <config-file target="AndroidManifest.xml" parent="/manifest/application"> <activity android:name="com.phonegap.plugins.childBrowser.ChildBrowser" android:label="@string/app_name"> <intent-filter> </intent-filter> </activity> </config-file> <config-file target="res/xml/plugins.xml" parent="/plugins"> <plugin name="ChildBrowser" value="com.phonegap.plugins.childBrowser.ChildBrowser"/> </config-file> <config-file target="res/xml/config.xml" parent="/cordova/plugins"> <plugin name="ChildBrowser" value="com.phonegap.plugins.childBrowser.ChildBrowser"/> </config-file> <source-file src="src/android/ChildBrowser.java" target-dir="src/com/phonegap/plugins/childBrowser" /> </platform> <platform name="ios"> <plugins-plist key="ChildBrowser" string="ChildBrowserCommand" /> <resource-file src="ChildBrowser.bundle" /> <resource-file src="ChildBrowserViewController.xib" /> <header-file src="ChildBrowserCommand.h" /> <header-file src="ChildBrowserViewController.h" /> <source-file src="ChildBrowserCommand.m" /> <source-file src="ChildBrowserViewController.m" /> </platform> </plugin>
Application file structure
/index.html /config.xml /adMob /plugin.xml /src /iOS /GADAdMobExtras.h (from AdMob iOS SDK) /GADAdNetworkExtras.h (from AdMob iOS SDK) /GADAdSize.h (from AdMob iOS SDK) /GADBannerView.h (from AdMob iOS SDK) /GADBannerViewDelegate.h (from AdMob iOS SDK) /GADInterstitial.h (from AdMob iOS SDK) /GADInterstitialDelegate.h (from AdMob iOS SDK) /GADRequest.h (from AdMob iOS SDK) /GADRequestError.h (from AdMob iOS SDK) /libGoogleAdMobAds.a (from AdMob iOS SDK) /AdMobPlugin.h (from Phonegap Plugin for iOS) /AdMobPlugin.js (from Phonegap Plugin for iOS) /AdMobPlugin.m (from Phonegap Plugin for iOS) /android /AdMobPlugin.java (from Phonegap Plugin for Android) /AdMobPlugin.js (from Phonegap Plugin for Android) /GoogleAdMobAdsSdk-6.2.1.jar (from AdMob Android SDK)
Phone plugin for iOS
AdMob iOS SDK
Android Phone Plugin
AdMob Android SDK
cordova admob phonegap-build phonegap-plugins
Mark Rummel Feb 12 '13 at 23:15 2013-02-12 23:15
source share