Exemplo n.º 1
0
    public void NewObject()
    {
        var obj = new AdBannerView();

        Assert.AreNotEqual(IntPtr.Zero, obj.ClassHandle);
        Assert.AreNotEqual(IntPtr.Zero, obj.Handle);
    }
Exemplo n.º 2
0
    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);
    }
Exemplo n.º 3
0
    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);
    }
Exemplo n.º 4
0
 public void ObjectSame()
 {
     var a = new AdBannerView(AdType.MediumRectangle);
     var b = Runtime.GetNSObject<AdBannerView>(a.Handle);
     Assert.AreSame(a, b);
 }
Exemplo n.º 5
0
 public void NewObjectWithType()
 {
     var type = AdType.MediumRectangle;
     var obj = new AdBannerView(type);
     Assert.AreEqual(type, obj.AdType);
 }
Exemplo n.º 6
0
 public void NewObjectWithFrame()
 {
     var frame = new CGRect(0, 1, 2, 3);
     var obj = new AdBannerView(frame);
     Assert.AreNotEqual(CGRect.Empty, obj.Frame);
 }
Exemplo n.º 7
0
 public void NewObjectDispose()
 {
     var obj = new AdBannerView();
     obj.Dispose();
 }