-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* max mrec support * Revert "max mrec support" This reverts commit c42a9c9. * max mrec support * Revert "max mrec support" This reverts commit 6c16ea5. * Revert "Revert "max mrec support"" This reverts commit 9bce37b. * Re-add view controllers * Update Main.storyboard * Re-add view controllers * Update project.pbxproj * Remove pod from pbxproj This reverts commit 27d2a4a. * Mrec->MRec * Mrec->MRec * Update Main.storyboard * Remove duplicated files * Update comment * Update comments
- Loading branch information
Showing
31 changed files
with
1,388 additions
and
320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...p - ObjC/AppLovin MAX Demo App - ObjC/MAX/Banners/ALMAXAutoLayoutBannerAdViewController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
... - ObjC/AppLovin MAX Demo App - ObjC/MAX/Banners/ALMAXFrameLayoutBannerAdViewController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
... - ObjC/AppLovin MAX Demo App - ObjC/MAX/Banners/ALMAXFrameLayoutBannerAdViewController.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...jC/AppLovin MAX Demo App - ObjC/MAX/Banners/ALMAXInterfaceBuilderBannerAdViewController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...jC/AppLovin MAX Demo App - ObjC/MAX/Banners/ALMAXInterfaceBuilderBannerAdViewController.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...- ObjC/AppLovin MAX Demo App - ObjC/MAX/Interstitials/ALMAXInterstitialAdViewController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...- ObjC/AppLovin MAX Demo App - ObjC/MAX/Interstitials/ALMAXInterstitialAdViewController.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...o App - ObjC/AppLovin MAX Demo App - ObjC/MAX/MRECs/ALMAXAutoLayoutMRecAdViewController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// ALMAXAutoLayoutMRecAdViewController.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 ALMAXAutoLayoutMRecAdViewController : ALBaseAdViewController | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
88 changes: 88 additions & 0 deletions
88
...o App - ObjC/AppLovin MAX Demo App - ObjC/MAX/MRECs/ALMAXAutoLayoutMRecAdViewController.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
// | ||
// ALMAXAutoLayoutMRecAdViewController.m | ||
// DemoApp-ObjC | ||
// | ||
// Created by Andrew Tian on 1/14/20. | ||
// Copyright © 2020 AppLovin Corporation. All rights reserved. | ||
// | ||
|
||
#import "ALMAXAutoLayoutMRecAdViewController.h" | ||
#import <AppLovinSDK/AppLovinSDK.h> | ||
|
||
@interface ALMAXAutoLayoutMRecAdViewController()<MAAdViewAdDelegate> | ||
@property (nonatomic, strong) MAAdView *adView; | ||
@end | ||
|
||
@implementation ALMAXAutoLayoutMRecAdViewController | ||
|
||
#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 |
17 changes: 17 additions & 0 deletions
17
... App - ObjC/AppLovin MAX Demo App - ObjC/MAX/MRECs/ALMAXFrameLayoutMRecAdViewController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// ALMAXFrameLayoutMRecAdViewController.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 ALMAXFrameLayoutMRecAdViewController : ALBaseAdViewController | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
88 changes: 88 additions & 0 deletions
88
... App - ObjC/AppLovin MAX Demo App - ObjC/MAX/MRECs/ALMAXFrameLayoutMRecAdViewController.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
// | ||
// ALMAXFrameLayoutMRecAdViewController.m | ||
// DemoApp-ObjC | ||
// | ||
// Created by Andrew Tian on 1/23/20. | ||
// Copyright © 2020 AppLovin Corporation. All rights reserved. | ||
// | ||
|
||
#import "ALMAXFrameLayoutMRecAdViewController.h" | ||
#import <AppLovinSDK/AppLovinSDK.h> | ||
|
||
@interface ALMAXFrameLayoutMRecAdViewController()<MAAdViewAdDelegate> | ||
@property (nonatomic, strong) MAAdView *adView; | ||
@end | ||
|
||
@implementation ALMAXFrameLayoutMRecAdViewController | ||
|
||
#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 |
Oops, something went wrong.