public void NewObject() { var obj = new AdBannerView(); Assert.AreNotEqual(IntPtr.Zero, obj.ClassHandle); Assert.AreNotEqual(IntPtr.Zero, obj.Handle); }
public void LoadAd() { var bannerView = new AdBannerView(); bannerView.AdLoaded += (sender, e) => { Console.WriteLine("AdLoaded!"); bannerView.RemoveFromSuperview(); }; bannerView.FailedToReceiveAd += (sender, e) => { Console.WriteLine("AdFailed: " + e.Error.LocalizedDescription); bannerView.RemoveFromSuperview(); }; UIApplication.SharedApplication.KeyWindow.RootViewController.View.AddSubview(bannerView); }
public void AdBannerViewExample() { if (Application.platform != RuntimePlatform.IPhonePlayer) { Debug.Log("Only supported on iOS!"); return; } var bannerView = new AdBannerView(); bannerView.AdLoaded += (sender, e) => { Debug.Log("Ad Loaded!"); }; bannerView.FailedToReceiveAd += (sender, e) => { Debug.Log("AdFailed: " + e.Error.LocalizedDescription); }; var controller = GetUnityController(); controller.View.AddSubview(bannerView); }
public void ObjectSame() { var a = new AdBannerView(AdType.MediumRectangle); var b = Runtime.GetNSObject<AdBannerView>(a.Handle); Assert.AreSame(a, b); }
public void NewObjectWithType() { var type = AdType.MediumRectangle; var obj = new AdBannerView(type); Assert.AreEqual(type, obj.AdType); }
public void NewObjectWithFrame() { var frame = new CGRect(0, 1, 2, 3); var obj = new AdBannerView(frame); Assert.AreNotEqual(CGRect.Empty, obj.Frame); }
public void NewObjectDispose() { var obj = new AdBannerView(); obj.Dispose(); }