Skip to content

Commit

Permalink
Feat/migrate AppLovin APIs (#17)
Browse files Browse the repository at this point in the history
* Migrating AppLovin ads for interstitials

* Deleting mediation debugger icon and adding it under MAX, removing subtitles

* interstitial UI changes

* Rewarded ad changes

* Banner ad changes

* Leaders changes

* MRECs changes

* Native Ads Changes

* Event Tracking changes

* Support changes

* adding mute button and and correcting titles for navigation items

* Restructure projects

* WIP

* Select Info.plist

* Organize project

* adding Interface Builder to MRECs

* Re-name projects

* landscape support and support across devices for Interface Builder

* correcting project structure for base files

* integrating MAX ads and AppLovin Interstitial in Swift

* AppLovin Interstitials in Swift

* Swift : AppLovin Rewarded Ads

* Fix file reference issues

* feat/use_exponential_delay_for_fullscreen_ad_load_fail_retries (#16)

* feat/use_exponential_delay_for_fullscreen_ad_load_fail_retries

* Reset retry attempt on ad load

* migration of banner, leaders, native, mrecs, events, support and mute

* Adding Mediation Debugger to the table under MAX instead of as an icon at the top toolbar

* Updating navigation item title and adding callback table view to banners

* Adding interface builder for MRecs in Swift

* renaming ObjC Demo App classes (AL -> ALMAX)

* renaming Swift Demo App classes (AL -> ALMAX)

* Update some copy

* Deintegrate CocoaPods

Co-authored-by: Varsha Hanji <[email protected]>
  • Loading branch information
thomasmso and alvarshahanji authored Apr 16, 2020
1 parent 28c16cb commit efa7748
Show file tree
Hide file tree
Showing 241 changed files with 16,626 additions and 1,849 deletions.

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// ALDemoInterfaceBuilderBannerViewController.h
// iOS-SDK-Demo-ObjC
//
// Created by Thomas So on 3/6/17.
// Copyright © 2017 AppLovin. All rights reserved.
//

#import "ALBaseAdViewController.h"

@interface ALDemoInterfaceBuilderBannerViewController : ALBaseAdViewController

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
//
// ALDemoInterfaceBuilderBannerViewController.m
// iOS-SDK-Demo-ObjC
//
// Created by Thomas So on 3/6/17.
// Copyright © 2017 AppLovin. All rights reserved.
//

#import "ALDemoInterfaceBuilderBannerViewController.h"
#import <AppLovinSDK/AppLovinSDK.h>

@interface ALDemoInterfaceBuilderBannerViewController()<ALAdLoadDelegate, ALAdDisplayDelegate, ALAdViewEventDelegate>
@property (nonatomic, weak) IBOutlet ALAdView *adView;
@property (nonatomic, weak) IBOutlet UIBarButtonItem *loadButton;
@end

@implementation ALDemoInterfaceBuilderBannerViewController

#pragma mark - View Lifecycle

- (void)viewDidLoad
{
[super viewDidLoad];

self.adView.adLoadDelegate = self;
self.adView.adDisplayDelegate = self;
self.adView.adEventDelegate = self;
}

- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear: animated];

self.adView.adLoadDelegate = nil;
self.adView.adDisplayDelegate = nil;
self.adView.adEventDelegate = nil;
}

#pragma mark - IB Action

- (IBAction)loadNextAd
{
[self.adView loadNextAd];

self.loadButton.enabled = NO;
}

#pragma mark - Ad Load Delegate

- (void)adService:(ALAdService *)adService didLoadAd:(ALAd *)ad
{
[self logCallback: __PRETTY_FUNCTION__];
}

- (void)adService:(ALAdService *)adService didFailToLoadAdWithError:(int)code
{
// Look at ALErrorCodes.h for list of error codes
[self logCallback: __PRETTY_FUNCTION__];

self.loadButton.enabled = YES;
}

#pragma mark - Ad Display Delegate

- (void)ad:(ALAd *)ad wasDisplayedIn:(UIView *)view
{
[self logCallback: __PRETTY_FUNCTION__];

self.loadButton.enabled = YES;
}

- (void)ad:(ALAd *)ad wasHiddenIn:(UIView *)view
{
[self logCallback: __PRETTY_FUNCTION__];
}

- (void)ad:(ALAd *)ad wasClickedIn:(UIView *)view
{
[self logCallback: __PRETTY_FUNCTION__];
}

#pragma mark - Ad View Event Delegate

- (void)ad:(ALAd *)ad didPresentFullscreenForAdView:(ALAdView *)adView
{
[self logCallback: __PRETTY_FUNCTION__];
}

- (void)ad:(ALAd *)ad willDismissFullscreenForAdView:(ALAdView *)adView
{
[self logCallback: __PRETTY_FUNCTION__];
}

- (void)ad:(ALAd *)ad didDismissFullscreenForAdView:(ALAdView *)adView
{
[self logCallback: __PRETTY_FUNCTION__];
}

- (void)ad:(ALAd *)ad willLeaveApplicationForAdView:(ALAdView *)adView
{
[self logCallback: __PRETTY_FUNCTION__];
}

- (void)ad:(ALAd *)ad didFailToDisplayInAdView:(ALAdView *)adView withError:(ALAdViewDisplayErrorCode)code
{
[self logCallback: __PRETTY_FUNCTION__];
}

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// ALDemoProgrammaticBannerViewController.h
// iOS-SDK-Demo-ObjC
//
// Created by Thomas So on 3/5/17.
// Copyright © 2017 AppLovin. All rights reserved.
//

#import "ALBaseAdViewController.h"

@interface ALDemoProgrammaticBannerViewController : ALBaseAdViewController

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
//
// ALDemoProgrammaticBannerViewController.m
// iOS-SDK-Demo-ObjC
//
// Created by Thomas So on 3/5/17.
// Copyright © 2017 AppLovin. All rights reserved.
//

#import "ALDemoProgrammaticBannerViewController.h"
#import <AppLovinSDK/AppLovinSDK.h>

@interface ALDemoProgrammaticBannerViewController()<ALAdLoadDelegate, ALAdDisplayDelegate, ALAdViewEventDelegate>
@property (nonatomic, strong) ALAdView *adView;
@property (nonatomic, weak) IBOutlet UIBarButtonItem *loadButton;
@end

@implementation ALDemoProgrammaticBannerViewController
static const CGFloat kBannerHeight = 50.0f;

#pragma mark - View Lifecycle

- (void)viewDidLoad
{
[super viewDidLoad];

// Create the banner view
self.adView = [[ALAdView alloc] initWithSize: ALAdSize.banner];

// Optional: Implement the ad delegates to receive ad events.
self.adView.adLoadDelegate = self;
self.adView.adDisplayDelegate = self;
self.adView.adEventDelegate = self;
self.adView.translatesAutoresizingMaskIntoConstraints = NO;

// Call loadNextAd() to start showing ads
[self.adView loadNextAd];

// Center the banner and anchor it to the bottom of the screen.
[self.view addSubview: self.adView];
[self.view addConstraints: @[[self constraintWithAdView: self.adView andAttribute: NSLayoutAttributeLeading],
[self constraintWithAdView: self.adView andAttribute: NSLayoutAttributeTrailing],
[self constraintWithAdView: self.adView andAttribute: NSLayoutAttributeBottom],
[NSLayoutConstraint constraintWithItem: self.adView
attribute: NSLayoutAttributeHeight
relatedBy: NSLayoutRelationEqual
toItem: nil
attribute: NSLayoutAttributeNotAnAttribute
multiplier: 1.0
constant: kBannerHeight]]];
}

- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear: animated];

self.adView.adLoadDelegate = nil;
self.adView.adDisplayDelegate = nil;
self.adView.adEventDelegate = nil;
}

- (NSLayoutConstraint *)constraintWithAdView:(ALAdView *)adView andAttribute:(NSLayoutAttribute)attribute
{
return [NSLayoutConstraint constraintWithItem: self.adView
attribute: attribute
relatedBy: NSLayoutRelationEqual
toItem: self.view
attribute: attribute
multiplier: 1.0
constant: 0.0];
}

#pragma mark - IB Action

- (IBAction)loadNextAd
{
[self.adView loadNextAd];

self.loadButton.enabled = NO;
}

#pragma mark - Ad Load Delegate

- (void)adService:(ALAdService *)adService didLoadAd:(ALAd *)ad
{
[self logCallback: __PRETTY_FUNCTION__];
}

- (void)adService:(ALAdService *)adService didFailToLoadAdWithError:(int)code
{
// Look at ALErrorCodes.h for list of error codes
[self logCallback: __PRETTY_FUNCTION__];

self.loadButton.enabled = YES;
}

#pragma mark - Ad Display Delegate

- (void)ad:(ALAd *)ad wasDisplayedIn:(UIView *)view
{
[self logCallback: __PRETTY_FUNCTION__];

self.loadButton.enabled = YES;
}

- (void)ad:(ALAd *)ad wasHiddenIn:(UIView *)view
{
[self logCallback: __PRETTY_FUNCTION__];
}

- (void)ad:(ALAd *)ad wasClickedIn:(UIView *)view
{
[self logCallback: __PRETTY_FUNCTION__];
}

#pragma mark - Ad View Event Delegate

- (void)ad:(ALAd *)ad didPresentFullscreenForAdView:(ALAdView *)adView
{
[self logCallback: __PRETTY_FUNCTION__];
}

- (void)ad:(ALAd *)ad willDismissFullscreenForAdView:(ALAdView *)adView
{
[self logCallback: __PRETTY_FUNCTION__];
}

- (void)ad:(ALAd *)ad didDismissFullscreenForAdView:(ALAdView *)adView
{
[self logCallback: __PRETTY_FUNCTION__];
}

- (void)ad:(ALAd *)ad willLeaveApplicationForAdView:(ALAdView *)adView
{
[self logCallback: __PRETTY_FUNCTION__];
}

- (void)ad:(ALAd *)ad didFailToDisplayInAdView:(ALAdView *)adView withError:(ALAdViewDisplayErrorCode)code
{
[self logCallback: __PRETTY_FUNCTION__];
}

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// ALDemoBannerZoneViewController.h
// iOS-SDK-Demo-ObjC
//
// Created by Suyash Saxena on 6/19/18.
// Copyright © 2018 AppLovin. All rights reserved.
//

#import "ALBaseAdViewController.h"

@interface ALDemoBannerZoneViewController : ALBaseAdViewController

@end
Loading

0 comments on commit efa7748

Please sign in to comment.