From c4ca3912ad5040efbe3093243a6a5a6fcbdb3f6b Mon Sep 17 00:00:00 2001 From: denplenkin Date: Fri, 7 Oct 2016 15:45:27 +0300 Subject: [PATCH] Update ViewController.cs --- demoAppodeal/ViewController.cs | 62 ++-------------------------------- 1 file changed, 2 insertions(+), 60 deletions(-) diff --git a/demoAppodeal/ViewController.cs b/demoAppodeal/ViewController.cs index ae227e1..8325216 100644 --- a/demoAppodeal/ViewController.cs +++ b/demoAppodeal/ViewController.cs @@ -7,70 +7,18 @@ namespace demoAppodeal { - public class MyDelegate : AppodealNativeAdServiceDelegate - { - ViewController _controller = null; - - public MyDelegate(ViewController controller) - { - _controller = controller; - } - - public override void NativeAdServiceDidLoad(AppodealNativeAd nativeAd) - { - _controller.MyDelegateServiceDidLoad(nativeAd); - } - } - public partial class ViewController : UIViewController { public ViewController (IntPtr handle) : base (handle) { } - //AppodealNativeAdViewAttributes attributes; - //AppodealNativeAdView adView; - AppodealNativeAdService adService; - AppodealNativeAd ad; - - public void MyDelegateServiceDidLoad(AppodealNativeAd nativeAd) - { -// this.ad = new AppodealNativeAd (); -// this.ad = nativeAd; -// -// this.attributes = new AppodealNativeAdViewAttributes(); -// this.attributes.Width=320; -// this.attributes.Heigth=50; -// -// this.adView = AppodealNativeAdView.NativeAdViewWithType(AppodealNativeAdViewType.ContentStream, this.ad, this.attributes, UIApplication.SharedApplication.Windows[0].RootViewController); -// UIView view = new UIView (); -// view.Frame = new System.Drawing.Rectangle(10, 400, 320, 50); -// view.AddSubview(this.adView); -// View.AddSubview(view); - - this.ad = new AppodealNativeAd (); - this.ad = nativeAd; - - UIView view = new UIView (); - view.Frame = new System.Drawing.Rectangle(10, 350, 200, 200); - - var data = NSData.FromUrl(this.ad.Image.ImageUrl); - - UIImageView imageview = new UIImageView (UIImage.LoadFromData (data)); - imageview.Frame = new System.Drawing.Rectangle(0 ,0, 50,50); - - view.AddSubview(imageview); - - View.AddSubview(view); - this.ad.AttachToView(view, UIApplication.SharedApplication.Windows[0].RootViewController); - } - public override void ViewDidLoad () { base.ViewDidLoad (); // Perform any additional setup after loading the view, typically from a nib. - Appodeal.DisableNetworkForAdType(AppodealAdType.All, NetworkNames.kAppodealFacebookNetworkName); - Appodeal.InitializeWithApiKey("dee74c5129f53fc629a44a690a02296694e3eef99f2d3a5f", AppodealAdType.All); + + Appodeal.InitializeWithApiKey("dee74c5129f53fc629a44a690a02296694e3eef99f2d3a5f", AppodealAdType.Interstitial); BannerButton.TouchUpInside += (object sender, EventArgs e) => { Appodeal.ShowAd(AppodealShowStyle.BannerTop, UIApplication.SharedApplication.Windows[0].RootViewController); @@ -83,12 +31,6 @@ public override void ViewDidLoad () VideoButton.TouchUpInside += (object sender, EventArgs e) => { Appodeal.ShowAd(AppodealShowStyle.RewardedVideo, UIApplication.SharedApplication.Windows[0].RootViewController); }; - - LoadButton.TouchUpInside += (object sender, EventArgs e) => { - adService = new AppodealNativeAdService (); - adService.Delegate = new MyDelegate(this); - adService.LoadAd(); - }; } public override void DidReceiveMemoryWarning ()