我有一個使用alextouch綁定admob的monououch應用程序。我將.dll添加到了我的參考文獻中。這是我想爲其添加橫幅的.cs文件。admob與alextouch monotouch
public override void ViewDidLoad()
{
base.ViewDidLoad();
string url = "http://dummy-website-name.php";
NSUrlRequest req = new NSUrlRequest (new NSUrl (url));
WEB.LoadRequest (req);
var ad = new GADBannerView(GADAdSizeCons.MediumRectangle,new PointF(0,0))
{
AdUnitID = "a15179c91adb8e5",
RootViewController = this
};
ad.DidReceiveAd += delegate
{
this.View.AddSubview(ad);
Console.WriteLine("AD Received");
};
ad.DidFailToReceiveAdWithError += delegate(object sender, GADBannerViewDidFailWithErrorEventArgs e) {
Console.WriteLine(e.Error);
};
ad.WillPresentScreen += delegate {
Console.WriteLine("showing new screen");
};
ad.WillLeaveApplication += delegate {
Console.WriteLine("I will leave application");
};
ad.WillDismissScreen += delegate {
Console.WriteLine("Dismissing opened screen");
};
Console.Write("Requesting Ad");
ad.LoadRequest(new GADRequest());
}
當我在我的iphone上運行ios 6.1時,它沒有顯示任何廣告。在調試模式下,它聲明admob錯誤:未顯示廣告。在發佈模式中,它什麼也不說,也不顯示廣告。我是否還要將項目添加到與此uiviewcontroller相對應的.m或.h文件中?顯然,我一直在使用一個合適的發行商ID在我的monodroid應用程序版本...
是的,我試圖用一個在分量存儲器,但找不到任何地方的GoogleAdMobAds.dll。 – user1518003