-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
runner
authored and
runner
committed
Sep 28, 2023
1 parent
737812a
commit fa01420
Showing
96 changed files
with
1,340 additions
and
1,023 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
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
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,19 @@ | ||
#import <UIKit/UIKit.h> | ||
#import "UADSBannerView.h" | ||
#import "GADBannerViewBridge.h" | ||
#import "UADSWebViewEventSender.h" | ||
#import "GMAAdMetaData.h" | ||
#import "UADSGMAScar.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface UADSGADBannerWrapper : UIView | ||
@property (nonatomic, strong) GADBannerViewBridge *gadBanner; | ||
|
||
+ (instancetype)newWithMeta: (GMAAdMetaData *)meta eventSender: (id<UADSWebViewEventSender>)eventSender gmaScar:(UADSGMAScar*)gmaScar; | ||
- (void)addToBannerView: (UADSBannerView *)bannerView withSize: (CGSize)size; | ||
- (void)updateGADBannerRootViewController; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
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,69 @@ | ||
#import <UIKit/UIKit.h> | ||
#import "UIView+Subview.h" | ||
#import "UADSGADBannerWrapper.h" | ||
#import "UIViewController+TopController.h" | ||
#import "UIView+ParentViewController.h" | ||
#import "GMABannerWebViewEvent.h" | ||
|
||
@interface UADSGADBannerWrapper() | ||
@property (nonatomic, strong) id<UADSWebViewEventSender> eventSender; | ||
@property (nonatomic, strong) GMAAdMetaData *meta; | ||
@property (nonatomic, strong) UADSGMAScar *gmaScar; | ||
@end | ||
|
||
@implementation UADSGADBannerWrapper | ||
|
||
+ (instancetype)newWithMeta: (GMAAdMetaData *)meta eventSender: (id<UADSWebViewEventSender>)eventSender gmaScar:(UADSGMAScar*)gmaScar { | ||
UADSGADBannerWrapper *wrapper = [UADSGADBannerWrapper new]; | ||
wrapper.meta = meta; | ||
wrapper.eventSender = eventSender; | ||
wrapper.gmaScar = gmaScar; | ||
return wrapper; | ||
} | ||
|
||
- (void)addToBannerView: (UADSBannerView *)bannerView withSize: (CGSize)size { | ||
[bannerView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; | ||
[bannerView addSubview:self withSize:size]; | ||
|
||
UIView *gBannerView = self.gadBannerView; | ||
[self addSubview:gBannerView withSize:size]; | ||
|
||
[self updateGADBannerRootViewController]; | ||
} | ||
|
||
- (void)updateGADBannerRootViewController { | ||
[self.gadBanner setRootViewController: self.bannerRootViewController]; | ||
} | ||
|
||
- (UIViewController *)bannerRootViewController { | ||
return [self parentViewController] ?: [UIViewController uads_getTopController]; | ||
} | ||
|
||
- (UIView *)gadBannerView { | ||
return (UIView *)self.gadBanner.proxyObject; | ||
} | ||
|
||
- (void)willMoveToSuperview:(UIView *)newSuperview { | ||
if (newSuperview == nil) { | ||
[self.gmaScar removeAdForPlacement: self.meta.placementID]; | ||
} | ||
} | ||
|
||
- (void)willMoveToWindow:(UIWindow *)newWindow { | ||
if (newWindow) { | ||
[self updateGADBannerRootViewController]; | ||
[self sendAttachedEvent]; | ||
} else { | ||
[self sendDettachedEvent]; | ||
} | ||
} | ||
|
||
- (void)sendAttachedEvent { | ||
[self.eventSender sendEvent:[GMABannerWebViewEvent newBannerAttachedWithMeta: self.meta]]; | ||
} | ||
|
||
- (void)sendDettachedEvent { | ||
[self.eventSender sendEvent:[GMABannerWebViewEvent newBannerDetachedWithMeta: self.meta]]; | ||
} | ||
|
||
@end |
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
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
5 changes: 0 additions & 5 deletions
5
...eaderBiddingTokenReader/ScarHeaderBidding/UADSHeaderBiddingTokenReaderSCARSignalsConfig.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
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
10 changes: 0 additions & 10 deletions
10
...TokenReader/ScarHeaderBidding/UADSHeaderBiddingTokenReaderWithSCARSignalsHybridStrategy.h
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.