From f9b9fe5fa05cbbfc5b25de6de5ab6da3de1546d5 Mon Sep 17 00:00:00 2001 From: Andrew Tian Date: Tue, 28 Jan 2020 10:15:12 -0800 Subject: [PATCH] Revert "Feat/max_mrec_support (#14)" This reverts commit ac888a93f966e36dbe86c8f56dfa4f54098fc004. --- .../DemoApp-ObjC.xcodeproj/project.pbxproj | 22 +- .../Ads/ALAutoLayoutBannerAdViewController.m | 32 +- .../Ads/ALAutoLayoutMRecAdViewController.m | 88 ----- .../Ads/ALAutoLayoutMrecAdViewController.h | 17 - .../Ads/ALFrameLayoutMrecAdViewController.h | 17 - .../Ads/ALFrameLayoutMrecAdViewController.m | 88 ----- .../ALInterfaceBuilderMrecAdViewController.h | 17 - .../ALInterfaceBuilderMrecAdViewController.m | 77 ----- .../Base.lproj/Main.storyboard | 273 +--------------- .../DemoApp-Swift.xcodeproj/project.pbxproj | 18 +- .../ALAutoLayoutBannerAdViewController.swift | 19 +- .../ALAutoLayoutMrecAdViewController.swift | 60 ---- .../ALFrameLayoutMrecAdViewController.swift | 61 ---- ...InterfaceBuilderMrecAdViewController.swift | 50 --- .../Base.lproj/Main.storyboard | 305 ++---------------- 15 files changed, 89 insertions(+), 1055 deletions(-) delete mode 100644 DemoApp-ObjC/DemoApp-ObjC/Ads/ALAutoLayoutMRecAdViewController.m delete mode 100644 DemoApp-ObjC/DemoApp-ObjC/Ads/ALAutoLayoutMrecAdViewController.h delete mode 100644 DemoApp-ObjC/DemoApp-ObjC/Ads/ALFrameLayoutMrecAdViewController.h delete mode 100644 DemoApp-ObjC/DemoApp-ObjC/Ads/ALFrameLayoutMrecAdViewController.m delete mode 100644 DemoApp-ObjC/DemoApp-ObjC/Ads/ALInterfaceBuilderMrecAdViewController.h delete mode 100644 DemoApp-ObjC/DemoApp-ObjC/Ads/ALInterfaceBuilderMrecAdViewController.m delete mode 100644 DemoApp-Swift/DemoApp-Swift/Ads/ALAutoLayoutMrecAdViewController.swift delete mode 100644 DemoApp-Swift/DemoApp-Swift/Ads/ALFrameLayoutMrecAdViewController.swift delete mode 100644 DemoApp-Swift/DemoApp-Swift/Ads/ALInterfaceBuilderMrecAdViewController.swift diff --git a/DemoApp-ObjC/DemoApp-ObjC.xcodeproj/project.pbxproj b/DemoApp-ObjC/DemoApp-ObjC.xcodeproj/project.pbxproj index 434ef16392..7c4266022d 100644 --- a/DemoApp-ObjC/DemoApp-ObjC.xcodeproj/project.pbxproj +++ b/DemoApp-ObjC/DemoApp-ObjC.xcodeproj/project.pbxproj @@ -3,14 +3,13 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 50; objects = { /* Begin PBXBuildFile section */ 1D992FE6231FA1C400C472F8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1D992FE4231FA1C400C472F8 /* Main.storyboard */; }; 1D992FE8231FA1C500C472F8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1D992FE7231FA1C500C472F8 /* Assets.xcassets */; }; 1D992FEB231FA1C500C472F8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1D992FE9231FA1C500C472F8 /* LaunchScreen.storyboard */; }; - 371C9BD323CE8A8F0010DE84 /* ALAutoLayoutMrecAdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 371C9BD223CE8A8F0010DE84 /* ALAutoLayoutMrecAdViewController.m */; }; 37C7E1EB2328904E002165B5 /* ALAutoLayoutBannerAdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D0CB33523204D120076AAAA /* ALAutoLayoutBannerAdViewController.m */; }; 37C7E1EC2328904E002165B5 /* ALFrameLayoutBannerAdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 37C7E1E823285E94002165B5 /* ALFrameLayoutBannerAdViewController.m */; }; 37C7E1ED2328904E002165B5 /* ALInterstitialAdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D0CB32F23204CE70076AAAA /* ALInterstitialAdViewController.m */; }; @@ -19,8 +18,6 @@ 37C7E1F3232892CF002165B5 /* ALAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D992FDF231FA1C400C472F8 /* ALAppDelegate.m */; }; 37C7E1F523297423002165B5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D992FED231FA1C500C472F8 /* main.m */; }; 37C7E1F62329742E002165B5 /* ALHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D992FE2231FA1C400C472F8 /* ALHomeViewController.m */; }; - 37DD986423DA6D3500704AA5 /* ALFrameLayoutMrecAdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 37DD986323DA6D3500704AA5 /* ALFrameLayoutMrecAdViewController.m */; }; - 37DD986723DA700800704AA5 /* ALInterfaceBuilderMrecAdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 37DD986623DA700800704AA5 /* ALInterfaceBuilderMrecAdViewController.m */; }; C0DE8BB3234E8A86004B0CFC /* ALBaseAdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C0DE8BB2234E8A86004B0CFC /* ALBaseAdViewController.m */; }; /* End PBXBuildFile section */ @@ -41,16 +38,10 @@ 1D992FEA231FA1C500C472F8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 1D992FEC231FA1C500C472F8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 1D992FED231FA1C500C472F8 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 371C9BD223CE8A8F0010DE84 /* ALAutoLayoutMrecAdViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ALAutoLayoutMrecAdViewController.m; sourceTree = ""; }; - 371C9BD423CE8AAC0010DE84 /* ALAutoLayoutMrecAdViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ALAutoLayoutMrecAdViewController.h; sourceTree = ""; }; 37C7E1E523285B4E002165B5 /* ALInterfaceBuilderBannerAdViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ALInterfaceBuilderBannerAdViewController.m; sourceTree = ""; }; 37C7E1E723285B6A002165B5 /* ALInterfaceBuilderBannerAdViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ALInterfaceBuilderBannerAdViewController.h; sourceTree = ""; }; 37C7E1E823285E94002165B5 /* ALFrameLayoutBannerAdViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ALFrameLayoutBannerAdViewController.m; sourceTree = ""; }; 37C7E1EA23285EDF002165B5 /* ALFrameLayoutBannerAdViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ALFrameLayoutBannerAdViewController.h; sourceTree = ""; }; - 37DD986323DA6D3500704AA5 /* ALFrameLayoutMrecAdViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ALFrameLayoutMrecAdViewController.m; sourceTree = ""; }; - 37DD986523DA6D4D00704AA5 /* ALFrameLayoutMrecAdViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ALFrameLayoutMrecAdViewController.h; sourceTree = ""; }; - 37DD986623DA700800704AA5 /* ALInterfaceBuilderMrecAdViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ALInterfaceBuilderMrecAdViewController.m; sourceTree = ""; }; - 37DD986823DA701A00704AA5 /* ALInterfaceBuilderMrecAdViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ALInterfaceBuilderMrecAdViewController.h; sourceTree = ""; }; C0DE8BB1234E8A86004B0CFC /* ALBaseAdViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ALBaseAdViewController.h; sourceTree = ""; }; C0DE8BB2234E8A86004B0CFC /* ALBaseAdViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ALBaseAdViewController.m; sourceTree = ""; }; /* End PBXFileReference section */ @@ -71,20 +62,14 @@ children = ( 1D0CB33423204D120076AAAA /* ALAutoLayoutBannerAdViewController.h */, 1D0CB33523204D120076AAAA /* ALAutoLayoutBannerAdViewController.m */, - 371C9BD423CE8AAC0010DE84 /* ALAutoLayoutMrecAdViewController.h */, - 371C9BD223CE8A8F0010DE84 /* ALAutoLayoutMrecAdViewController.m */, 37C7E1EA23285EDF002165B5 /* ALFrameLayoutBannerAdViewController.h */, 37C7E1E823285E94002165B5 /* ALFrameLayoutBannerAdViewController.m */, - 37DD986523DA6D4D00704AA5 /* ALFrameLayoutMrecAdViewController.h */, - 37DD986323DA6D3500704AA5 /* ALFrameLayoutMrecAdViewController.m */, 1D0CB32E23204CE70076AAAA /* ALInterstitialAdViewController.h */, 1D0CB32F23204CE70076AAAA /* ALInterstitialAdViewController.m */, 1D0CB33123204CF70076AAAA /* ALRewardedAdViewController.h */, 1D0CB33223204CF70076AAAA /* ALRewardedAdViewController.m */, 37C7E1E723285B6A002165B5 /* ALInterfaceBuilderBannerAdViewController.h */, 37C7E1E523285B4E002165B5 /* ALInterfaceBuilderBannerAdViewController.m */, - 37DD986823DA701A00704AA5 /* ALInterfaceBuilderMrecAdViewController.h */, - 37DD986623DA700800704AA5 /* ALInterfaceBuilderMrecAdViewController.m */, ); path = Ads; sourceTree = ""; @@ -113,9 +98,9 @@ 1D992FDF231FA1C400C472F8 /* ALAppDelegate.m */, 1D992FE1231FA1C400C472F8 /* ALHomeViewController.h */, 1D992FE2231FA1C400C472F8 /* ALHomeViewController.m */, + 1D993015231FA39000C472F8 /* Supporting Files */, C0DE8BB1234E8A86004B0CFC /* ALBaseAdViewController.h */, C0DE8BB2234E8A86004B0CFC /* ALBaseAdViewController.m */, - 1D993015231FA39000C472F8 /* Supporting Files */, ); path = "DemoApp-ObjC"; sourceTree = ""; @@ -203,17 +188,14 @@ buildActionMask = 2147483647; files = ( C0DE8BB3234E8A86004B0CFC /* ALBaseAdViewController.m in Sources */, - 37DD986423DA6D3500704AA5 /* ALFrameLayoutMrecAdViewController.m in Sources */, 37C7E1F62329742E002165B5 /* ALHomeViewController.m in Sources */, 37C7E1F523297423002165B5 /* main.m in Sources */, 37C7E1F3232892CF002165B5 /* ALAppDelegate.m in Sources */, 37C7E1EB2328904E002165B5 /* ALAutoLayoutBannerAdViewController.m in Sources */, 37C7E1EC2328904E002165B5 /* ALFrameLayoutBannerAdViewController.m in Sources */, - 371C9BD323CE8A8F0010DE84 /* ALAutoLayoutMrecAdViewController.m in Sources */, 37C7E1ED2328904E002165B5 /* ALInterstitialAdViewController.m in Sources */, 37C7E1EE2328904E002165B5 /* ALRewardedAdViewController.m in Sources */, 37C7E1EF2328904E002165B5 /* ALInterfaceBuilderBannerAdViewController.m in Sources */, - 37DD986723DA700800704AA5 /* ALInterfaceBuilderMrecAdViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/DemoApp-ObjC/DemoApp-ObjC/Ads/ALAutoLayoutBannerAdViewController.m b/DemoApp-ObjC/DemoApp-ObjC/Ads/ALAutoLayoutBannerAdViewController.m index e81000b4f5..dafff9f0ef 100644 --- a/DemoApp-ObjC/DemoApp-ObjC/Ads/ALAutoLayoutBannerAdViewController.m +++ b/DemoApp-ObjC/DemoApp-ObjC/Ads/ALAutoLayoutBannerAdViewController.m @@ -30,18 +30,34 @@ - (void)viewDidLoad [self.view addSubview: self.adView]; - // Anchor the banner to the left, right, and top of the screen. - [[self.adView.leadingAnchor constraintEqualToAnchor: self.view.leadingAnchor] setActive: YES]; - [[self.adView.trailingAnchor constraintEqualToAnchor: self.view.trailingAnchor] setActive: YES]; - [[self.adView.topAnchor constraintEqualToAnchor: self.view.topAnchor] setActive: YES]; - - [[self.adView.widthAnchor constraintEqualToAnchor: self.view.widthAnchor] setActive: YES]; - [[self.adView.heightAnchor constraintEqualToConstant: UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad ? 90 : 50 ] setActive: YES]; - + // Center the banner and anchor it to the top of the screen. + CGFloat height = (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) ? 90 : 50; // Banner height on iPhone and iPad is 50 and 90, respectively + [self.view addConstraints: @[[self constraintWithAdView: self.adView andAttribute: NSLayoutAttributeLeading], + [self constraintWithAdView: self.adView andAttribute: NSLayoutAttributeTrailing], + [self constraintWithAdView: self.adView andAttribute: NSLayoutAttributeTop], + [NSLayoutConstraint constraintWithItem: self.adView + attribute: NSLayoutAttributeHeight + relatedBy: NSLayoutRelationEqual + toItem: nil + attribute: NSLayoutAttributeNotAnAttribute + multiplier: 1.0 + constant: height]]]; + // Load the first ad [self.adView loadAd]; } +- (NSLayoutConstraint *)constraintWithAdView:(MAAdView *)adView andAttribute:(NSLayoutAttribute)attribute +{ + return [NSLayoutConstraint constraintWithItem: adView + attribute: attribute + relatedBy: NSLayoutRelationEqual + toItem: self.view + attribute: attribute + multiplier: 1.0 + constant: 0.0]; +} + #pragma mark - MAAdDelegate Protocol - (void)didLoadAd:(MAAd *)ad diff --git a/DemoApp-ObjC/DemoApp-ObjC/Ads/ALAutoLayoutMRecAdViewController.m b/DemoApp-ObjC/DemoApp-ObjC/Ads/ALAutoLayoutMRecAdViewController.m deleted file mode 100644 index 145ef65fbc..0000000000 --- a/DemoApp-ObjC/DemoApp-ObjC/Ads/ALAutoLayoutMRecAdViewController.m +++ /dev/null @@ -1,88 +0,0 @@ -// -// ALAutoLayoutMrecAdViewController.m -// DemoApp-ObjC -// -// Created by Andrew Tian on 1/14/20. -// Copyright © 2020 AppLovin Corporation. All rights reserved. -// - -#import "ALAutoLayoutMrecAdViewController.h" -#import - -@interface ALAutoLayoutMrecAdViewController() -@property (nonatomic, strong) MAAdView *adView; -@end - -@implementation ALAutoLayoutMrecAdViewController - -#pragma mark - View Lifecycle - -- (void)viewDidLoad -{ - [super viewDidLoad]; - - self.adView = [[MAAdView alloc] initWithAdUnitIdentifier: @"YOUR_AD_UNIT_ID" adFormat: MAAdFormat.mrec]; - self.adView.delegate = self; - self.adView.translatesAutoresizingMaskIntoConstraints = NO; - - // Set background or background color for MRECs to be fully functional - self.adView.backgroundColor = UIColor.blackColor; - - [self.view addSubview: self.adView]; - - // Center the MREC and anchor it to the top of the screen. - [[self.adView.centerXAnchor constraintEqualToAnchor: self.view.centerXAnchor] setActive: YES]; - [[self.adView.topAnchor constraintEqualToAnchor: self.view.topAnchor] setActive: YES]; - - [[self.adView.widthAnchor constraintEqualToConstant: 300] setActive: YES]; - [[self.adView.heightAnchor constraintEqualToConstant: 250] setActive: YES]; - - // Load the first ad - [self.adView loadAd]; -} - -#pragma mark - MAAdDelegate Protocol - -- (void)didLoadAd:(MAAd *)ad -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -- (void)didFailToLoadAdForAdUnitIdentifier:(NSString *)adUnitIdentifier withErrorCode:(NSInteger)errorCode -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -- (void)didDisplayAd:(MAAd *)ad -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -- (void)didHideAd:(MAAd *)ad -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -- (void)didClickAd:(MAAd *)ad -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -- (void)didFailToDisplayAd:(MAAd *)ad withErrorCode:(NSInteger)errorCode -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -#pragma mark - MAAdViewAdDelegate Protocol - -- (void)didExpandAd:(MAAd *)ad -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -- (void)didCollapseAd:(MAAd *)ad -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -@end diff --git a/DemoApp-ObjC/DemoApp-ObjC/Ads/ALAutoLayoutMrecAdViewController.h b/DemoApp-ObjC/DemoApp-ObjC/Ads/ALAutoLayoutMrecAdViewController.h deleted file mode 100644 index dbec873b39..0000000000 --- a/DemoApp-ObjC/DemoApp-ObjC/Ads/ALAutoLayoutMrecAdViewController.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// ALAutoLayoutMrecAdViewController.h -// DemoApp-ObjC -// -// Created by Andrew Tian on 1/14/20. -// Copyright © 2020 AppLovin Corporation. All rights reserved. -// - -#import "ALBaseAdViewController.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface ALAutoLayoutMrecAdViewController : ALBaseAdViewController - -@end - -NS_ASSUME_NONNULL_END diff --git a/DemoApp-ObjC/DemoApp-ObjC/Ads/ALFrameLayoutMrecAdViewController.h b/DemoApp-ObjC/DemoApp-ObjC/Ads/ALFrameLayoutMrecAdViewController.h deleted file mode 100644 index 2515f46fa4..0000000000 --- a/DemoApp-ObjC/DemoApp-ObjC/Ads/ALFrameLayoutMrecAdViewController.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// ALFrameLayoutMrecAdViewController.h -// DemoApp-ObjC -// -// Created by Andrew Tian on 1/23/20. -// Copyright © 2020 AppLovin Corporation. All rights reserved. -// - -#import "ALBaseAdViewController.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface ALFrameLayoutMrecAdViewController : ALBaseAdViewController - -@end - -NS_ASSUME_NONNULL_END diff --git a/DemoApp-ObjC/DemoApp-ObjC/Ads/ALFrameLayoutMrecAdViewController.m b/DemoApp-ObjC/DemoApp-ObjC/Ads/ALFrameLayoutMrecAdViewController.m deleted file mode 100644 index 949a6d1017..0000000000 --- a/DemoApp-ObjC/DemoApp-ObjC/Ads/ALFrameLayoutMrecAdViewController.m +++ /dev/null @@ -1,88 +0,0 @@ -// -// ALFrameLayoutMrecAdViewController.m -// DemoApp-ObjC -// -// Created by Andrew Tian on 1/23/20. -// Copyright © 2020 AppLovin Corporation. All rights reserved. -// - -#import "ALFrameLayoutMrecAdViewController.h" -#import - -@interface ALFrameLayoutMrecAdViewController() -@property (nonatomic, strong) MAAdView *adView; -@end - -@implementation ALFrameLayoutMrecAdViewController - -#pragma mark - View Lifecycle - -- (void)viewDidLoad -{ - [super viewDidLoad]; - - self.adView = [[MAAdView alloc] initWithAdUnitIdentifier: @"YOUR_AD_UNIT_ID" adFormat: MAAdFormat.mrec]; - self.adView.delegate = self; - - // Dimensions - CGFloat width = 300; - CGFloat height = 250; - CGFloat x = self.view.center.x - 150; - CGFloat y = 0; - - self.adView.frame = CGRectMake(x, y, width, height); - - // Set background or background color for MRECs to be fully functional - self.adView.backgroundColor = UIColor.blackColor; - - [self.view addSubview: self.adView]; - - // Load the first ad - [self.adView loadAd]; -} - -#pragma mark - MAAdDelegate Protocol - -- (void)didLoadAd:(MAAd *)ad -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -- (void)didFailToLoadAdForAdUnitIdentifier:(NSString *)adUnitIdentifier withErrorCode:(NSInteger)errorCode -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -- (void)didDisplayAd:(MAAd *)ad -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -- (void)didHideAd:(MAAd *)ad -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -- (void)didClickAd:(MAAd *)ad -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -- (void)didFailToDisplayAd:(MAAd *)ad withErrorCode:(NSInteger)errorCode -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -#pragma mark - MAAdViewAdDelegate Protocol - -- (void)didExpandAd:(MAAd *)ad -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -- (void)didCollapseAd:(MAAd *)ad -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -@end diff --git a/DemoApp-ObjC/DemoApp-ObjC/Ads/ALInterfaceBuilderMrecAdViewController.h b/DemoApp-ObjC/DemoApp-ObjC/Ads/ALInterfaceBuilderMrecAdViewController.h deleted file mode 100644 index 2502574cbc..0000000000 --- a/DemoApp-ObjC/DemoApp-ObjC/Ads/ALInterfaceBuilderMrecAdViewController.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// ALInterfaceBuilderMrecAdViewController.h -// DemoApp-ObjC -// -// Created by Andrew Tian on 1/23/20. -// Copyright © 2020 AppLovin Corporation. All rights reserved. -// - -#import "ALBaseAdViewController.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface ALInterfaceBuilderMrecAdViewController : ALBaseAdViewController - -@end - -NS_ASSUME_NONNULL_END diff --git a/DemoApp-ObjC/DemoApp-ObjC/Ads/ALInterfaceBuilderMrecAdViewController.m b/DemoApp-ObjC/DemoApp-ObjC/Ads/ALInterfaceBuilderMrecAdViewController.m deleted file mode 100644 index af676a293e..0000000000 --- a/DemoApp-ObjC/DemoApp-ObjC/Ads/ALInterfaceBuilderMrecAdViewController.m +++ /dev/null @@ -1,77 +0,0 @@ -// -// ALInterfaceBuilderMrecAdViewController.m -// DemoApp-ObjC -// -// Created by Andrew Tian on 1/23/20. -// Copyright © 2020 AppLovin Corporation. All rights reserved. -// - -#import "ALInterfaceBuilderMrecAdViewController.h" -#import - -@interface ALInterfaceBuilderMrecAdViewController() -@property (nonatomic, strong) IBOutlet MAAdView *adView; -@end - -@implementation ALInterfaceBuilderMrecAdViewController - -#pragma mark - View Lifecycle - -- (void)viewDidLoad -{ - [super viewDidLoad]; - - // NOTE: Must set Storyboard "User Defined Runtime Attributes" for MREC ad view - // Key Path = ad_unit_id - // Type = String - // Value = YOUR_AD_UNIT_ID - - // Load the first ad - [self.adView loadAd]; -} - -#pragma mark - MAAdDelegate Protocol - -- (void)didLoadAd:(MAAd *)ad -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -- (void)didFailToLoadAdForAdUnitIdentifier:(NSString *)adUnitIdentifier withErrorCode:(NSInteger)errorCode -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -- (void)didDisplayAd:(MAAd *)ad -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -- (void)didHideAd:(MAAd *)ad -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -- (void)didClickAd:(MAAd *)ad -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -- (void)didFailToDisplayAd:(MAAd *)ad withErrorCode:(NSInteger)errorCode -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -#pragma mark - MAAdViewAdDelegate Protocol - -- (void)didExpandAd:(MAAd *)ad -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -- (void)didCollapseAd:(MAAd *)ad -{ - [self logCallback: __PRETTY_FUNCTION__]; -} - -@end diff --git a/DemoApp-ObjC/DemoApp-ObjC/Supporting Files/Base.lproj/Main.storyboard b/DemoApp-ObjC/DemoApp-ObjC/Supporting Files/Base.lproj/Main.storyboard index 735842a5b4..b2eb1ca071 100644 --- a/DemoApp-ObjC/DemoApp-ObjC/Supporting Files/Base.lproj/Main.storyboard +++ b/DemoApp-ObjC/DemoApp-ObjC/Supporting Files/Base.lproj/Main.storyboard @@ -1,9 +1,9 @@ - + - + @@ -24,11 +24,11 @@ - +