-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMoPub.m
87 lines (68 loc) · 2.01 KB
/
MoPub.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//
// MoPub.m
// MoPub
//
// Copyright (c) 2014 MoPub. All rights reserved.
//
#import "MoPub.h"
#import "MPConstants.h"
#import "MPCoreInstanceProvider.h"
#import "MPGeolocationProvider.h"
#import "MPRewardedVideo.h"
#import "FABKitProtocol.h"
#import "Fabric+FABKits.h"
@interface MoPub () <FABKit>
@property (nonatomic, strong) NSArray *globalMediationSettings;
@end
@implementation MoPub
+ (MoPub *)sharedInstance
{
static MoPub *sharedInstance = nil;
static dispatch_once_t initOnceToken;
dispatch_once(&initOnceToken, ^{
sharedInstance = [[MoPub alloc] init];
});
return sharedInstance;
}
+ (NSString *)bundleIdentifier
{
return MP_BUNDLE_IDENTIFIER;
}
+ (NSString *)kitDisplayVersion
{
return MP_SDK_VERSION;
}
- (void)setLocationUpdatesEnabled:(BOOL)locationUpdatesEnabled
{
_locationUpdatesEnabled = locationUpdatesEnabled;
[[[MPCoreInstanceProvider sharedProvider] sharedMPGeolocationProvider] setLocationUpdatesEnabled:locationUpdatesEnabled];
}
- (void)start
{
}
// Keep -version and -bundleIdentifier methods around for Fabric backwards compatibility.
- (NSString *)version
{
return MP_SDK_VERSION;
}
- (NSString *)bundleIdentifier
{
return MP_BUNDLE_IDENTIFIER;
}
- (void)initializeRewardedVideoWithGlobalMediationSettings:(NSArray *)globalMediationSettings delegate:(id<MPRewardedVideoDelegate>)delegate
{
// initializeWithDelegate: is a known private initialization method on MPRewardedVideo. So we forward the initialization call to that class.
[MPRewardedVideo performSelector:@selector(initializeWithDelegate:) withObject:delegate];
self.globalMediationSettings = globalMediationSettings;
}
- (id<MPMediationSettingsProtocol>)globalMediationSettingsForClass:(Class)aClass
{
NSArray *mediationSettingsCollection = self.globalMediationSettings;
for (id<MPMediationSettingsProtocol> settings in mediationSettingsCollection) {
if ([settings isKindOfClass:aClass]) {
return settings;
}
}
return nil;
}
@end