首先阅读官方文档:https://github.com/
按步就班注册获取AdMob Publisher ID已及开发SDK包和DEMO工程,确保官方的工程能正确运行:如果没法运行,再仔细阅读官方文档!!为了省事,就直接在BannerExampleViewController上修改。首先添加两个方法,1个单列1个用于显示广告的方法。import com.keymob.networks.AdManager;import com.keymob.networks.core.*;import com.keymob.sdk.core.AdTypes;把-(void)viewDidLoad方法内容移到- (id)showAdmob中,并稍作修改:<!-- base permission --><uses-permission android:name="android.permission.INTERNET"/><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/><uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/><uses-permission android:name="android.permission.READ_PHONE_STATE"/><!-- base permission for location--><uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /><uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /><!-- base permission required by chartboost and baidu--><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/><!-- permission required by mmedia --><uses-permission android:name="android.permission.RECORD_AUDIO" /><uses-feature android:name="android.hardware.microphone" android:required="false" />接下来实现单列:android:name="com.google.android.gms.ads.AdActivity"android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:theme=" :style/Theme.Translucent"/>最后实现unity需要的类,创建一个UMob.mm类,该类灰常简单,只有一个方法(用于unity中C#调用)<activity android:name="com.inmobi.androidsdk.IMBrowserActivity"android:configChanges="keyboardHidden|orientation|keyboard|smallestScreenSize|screenSize"android:theme=" :style/Theme.Translucent.NoTitleBar" android:hardwareAccelerated="true" />Xcode部分完成。把需要的文件拷贝到unity中,注意文件结构。Unity部分就更简单了。创建一个调用admob的类挂到场景中。<activity android:name="com.keymob.sdk.core.KeymobActivity" android:theme=" :style/Theme.Dialog"android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />