Skip to content

Commit 89616dc

Browse files
author
Nikolaï Roycourt
committed
Add mediation adapters
1 parent 82f5afd commit 89616dc

24 files changed

+413
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/Headers
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
framework module TeadsAdMobAdapter {
2+
umbrella header "TeadsAdMobAdapter.h"
3+
4+
export *
5+
module * { export * }
6+
7+
link framework "Foundation"
8+
link framework "UIKit"
9+
10+
header "GADMAdapterTeadsBanner.h"
11+
header "GADMAdapterTeadsExtras.h"
12+
header "GADMAdapterTeadsConstants.h"
13+
header "GADMAdapterTeadsInterstitial.h"
14+
header "GADMAdapterTeadsRewardedVideo.h"
15+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Versions/Current/TeadsAdMobAdapter
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// GADMAdapterTeadsBanner.h
3+
// TeadsAdMobAdapter
4+
//
5+
// Created by athomas on 29/05/2018.
6+
// Copyright © 2018 Teads. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
#import <GoogleMobileAds/GoogleMobileAds.h>
11+
12+
NS_ASSUME_NONNULL_BEGIN
13+
14+
/// Class adapting Teads banner to work with Google Mobile Ads mediation.
15+
@interface GADMAdapterTeadsBanner : NSObject <GADCustomEventBanner>
16+
17+
@end
18+
19+
NS_ASSUME_NONNULL_END
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//
2+
// GADMAdapterTeadsConstants.h
3+
// TeadsAdMobAdapter
4+
//
5+
// Created by athomas on 29/05/2018.
6+
// Copyright © 2018 Teads. All rights reserved.
7+
//
8+
9+
#ifndef GADMAdapterTeadsConstants_h
10+
#define GADMAdapterTeadsConstants_h
11+
12+
#import <Foundation/Foundation.h>
13+
14+
NS_ASSUME_NONNULL_BEGIN
15+
16+
/// Constants defined for Teads Adapter
17+
18+
static NSString * const TeadsAdapterErrorDomain = @"tv.teads.adapter.admob";
19+
20+
enum {
21+
PIDNotFound,
22+
LoadingFailure
23+
};
24+
typedef NSInteger TeadsAdapterErrorCode;
25+
26+
NS_ASSUME_NONNULL_END
27+
28+
#endif /* GADMAdapterTeadsConstants_h */
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
//
2+
// GADMAdapterTeadsExtras.h
3+
// TeadsAdMobAdapter
4+
//
5+
// Created by athomas on 29/05/2018.
6+
// Copyright © 2018 Teads. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
#import <GoogleMobileAds/GoogleMobileAds.h>
11+
#import <TeadsSDK/TeadsSDK.h>
12+
13+
NS_ASSUME_NONNULL_BEGIN
14+
15+
/// Class encapsulating extra parameters for Teads custom events.
16+
@interface GADMAdapterTeadsExtras : NSObject <GADAdNetworkExtras>
17+
18+
/// Enable test mode
19+
@property (nonatomic, assign) BOOL debugMode;
20+
21+
/// Enable location reporting
22+
@property (nonatomic, assign) BOOL reportLocation;
23+
24+
/// Enable light mode for endscreen
25+
@property (nonatomic, assign) BOOL lightEndscreenMode;
26+
27+
/// Enable media preloading
28+
@property (nonatomic, assign) BOOL mediaPreloadEnabled;
29+
30+
/// Brand safety url
31+
@property (nonatomic, strong) NSString *pageUrl;
32+
33+
// MARK: - Initializers
34+
35+
/// Default initializer.
36+
- (instancetype)init;
37+
38+
/// Convenient initializer creating an instance of `GADMAdapterTeadsExtras` from `GADRequest` `additionalParameters`.
39+
///
40+
/// + Doc for [GADRequest](https://developers.google.com/admob/ios/api/reference/Classes/GADRequest#-registeradnetworkextras)
41+
///
42+
/// - parameter parameters: `GADRequest` additional parameters.
43+
- (instancetype)initWithRequestAdditionalParameters:(NSDictionary *)parameters;
44+
45+
// MARK: - Helpers
46+
47+
/// Creates an instance of `GADCustomEventExtras` used when sending ad network extras for
48+
/// custom event requests (interstitial and banners) through `GADRequest`.
49+
///
50+
/// + Doc for [GADRequest](https://developers.google.com/admob/ios/api/reference/Classes/GADRequest#-registeradnetworkextras)
51+
/// + Doc for [GADCustomEventExtras](https://developers.google.com/admob/ios/api/reference/Classes/GADCustomEventExtras#-setextrasforlabel)
52+
///
53+
/// - parameter label: Custom event label defined on AdMob dashboard for the ad network.
54+
/// - returns: A `GADCustomEventExtras` containing extra parameters.
55+
- (GADCustomEventExtras *)getCustomEventExtrasForCustomEventLabel:(NSString *)label;
56+
57+
/// Creates an instance of `TeadsAdSettings` configured from ad network extra parameters.
58+
///
59+
/// + Doc for [GADRequest](https://developers.google.com/admob/ios/api/reference/Classes/GADRequest#-registeradnetworkextras)
60+
///
61+
/// - returns: A `TeadsAdSettings` containing settings to configure Teads ads.
62+
- (TeadsAdSettings *)getTeadsAdSettings;
63+
64+
@end
65+
66+
NS_ASSUME_NONNULL_END
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// GADMAdapterTeadsInterstitial.h
3+
// TeadsAdMobAdapter
4+
//
5+
// Created by athomas on 29/05/2018.
6+
// Copyright © 2018 Teads. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
#import <GoogleMobileAds/GoogleMobileAds.h>
11+
12+
NS_ASSUME_NONNULL_BEGIN
13+
14+
/// Class adapting Teads interstitial to work with Google Mobile Ads mediation.
15+
@interface GADMAdapterTeadsInterstitial : NSObject <GADCustomEventInterstitial>
16+
17+
@end
18+
19+
NS_ASSUME_NONNULL_END
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// GADMAdapterTeadsRewardedVideo.h
3+
// TeadsAdMobAdapter
4+
//
5+
// Created by athomas on 29/05/2018.
6+
// Copyright © 2018 Teads. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
#import <GoogleMobileAds/GoogleMobileAds.h>
11+
12+
NS_ASSUME_NONNULL_BEGIN
13+
14+
/// Class adapting Teads rewarded ad to work with Google Mobile Ads mediation.
15+
@interface GADMAdapterTeadsRewardedVideo : NSObject <GADMRewardBasedVideoAdNetworkAdapter>
16+
17+
@end
18+
19+
NS_ASSUME_NONNULL_END
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//
2+
// TeadsAdMobAdapter.h
3+
// TeadsAdMobAdapter
4+
//
5+
// Created by athomas on 22/05/2018.
6+
// Copyright © 2018 Teads. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
#import <UIKit/UIKit.h>
Binary file not shown.

0 commit comments

Comments
 (0)