Skip to content

Commit 9d7ccbc

Browse files
runnerrunner
authored andcommitted
Release 4.7.0
1 parent a72c241 commit 9d7ccbc

File tree

160 files changed

+2374
-1667
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+2374
-1667
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Unity Advertisements copyright © 2022 Unity Technologies.
1+
Unity Advertisements copyright © 2023 Unity Technologies.
22
This software is subject to, and made available under, the terms of service for Operate Solutions (see https://unity3d.com/legal/one-operate-services-terms-of-service), and is an "Operate Service" as defined therein.
33

44
Your use of the Services constitutes your acceptance of such terms. Unless expressly provided otherwise, the software under this license is made available strictly on an "AS IS" BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. Please review the terms of service for details on these and other terms and conditions.

SourceCode/Private/Core/Api/USRVApiSdk.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ typedef NS_ENUM (NSInteger, USRVDownloadLatestWebViewStatus) {
77
kDownloadLatestWebViewStatusMissingLatestConfig,
88
kDownloadLatestWebViewStatusBackgroundDownloadStarted
99
};
10-
+ (void)setServiceProviderForTesting: (id)sProvider;
11-
+ (void)WebViewExposed_getTrrData: (USRVWebViewCallback *)callback;
10+
+ (void)WebViewExposed_getTrrData: (nonnull USRVWebViewCallback *)callback;
1211
@end

SourceCode/Private/Core/Api/USRVApiSdk.m

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,8 @@
77
#import "USRVDevice.h"
88
#import "UADSServiceProviderContainer.h"
99

10-
static UADSServiceProvider* serviceProvider;
1110
@implementation USRVApiSdk
1211

13-
+ (void)load {
14-
serviceProvider = UADSServiceProviderContainer.sharedInstance.serviceProvider;
15-
}
16-
17-
+ (void)setServiceProviderForTesting: (UADSServiceProvider*)sProvider {
18-
serviceProvider = sProvider;
19-
}
20-
2112
+ (void)WebViewExposed_loadComplete: (USRVWebViewCallback *)callback {
2213
USRVLogDebug(@"Web application loaded");
2314
[[USRVWebViewApp getCurrentApp] setWebAppLoaded: true];
@@ -114,11 +105,11 @@ + (NSString *)privacyState {
114105
}
115106

116107
+ (void)WebViewExposed_getTrrData: (USRVWebViewCallback *)callback {
117-
[callback invoke: serviceProvider.configurationStorage.getCurrentConfiguration.originalJSON, nil];
108+
[callback invoke: UADSServiceProviderContainer.sharedInstance.serviceProvider.configurationStorage.getCurrentConfiguration.originalJSON, nil];
118109
}
119110

120111
+ (void)WebViewExposed_getSharedSessionID:(USRVWebViewCallback *)callback {
121-
[callback invoke: serviceProvider.sharedSessionId];
112+
[callback invoke: UADSServiceProviderContainer.sharedInstance.serviceProvider.sharedSessionId];
122113
}
123114

124115
@end

SourceCode/Private/Core/Configuration/SDKConfigurationReader/ConfigurationLoader/Decorators/UADSConfigurationLoaderWithPrivacy.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#import "UADSConfigurationLoaderWithPrivacy.h"
2+
#import "UADSErrorState.h"
23

34
@interface UADSConfigurationLoaderWithPrivacy ()
45
@property (nonatomic, strong) id<UADSConfigurationLoader>original;
56
@property (nonatomic, strong) id<UADSPrivacyLoader>privacyLoader;
67
@property (nonatomic, strong) id<UADSPrivacyResponseSaver, UADSPrivacyResponseReader>responseStorage;
8+
@property (nonatomic, strong) NSArray<NSNumber*> *fastFailCodes;
79
@end
810

911
@implementation UADSConfigurationLoaderWithPrivacy
@@ -17,6 +19,7 @@ + (instancetype)newWithOriginal: (id<UADSConfigurationLoader>)original
1719
decorator.original = original;
1820
decorator.privacyLoader = privacyLoader;
1921
decorator.responseStorage = responseStorage;
22+
decorator.fastFailCodes = @[@(kPrivacyGameIdDisabledCode)];
2023
return decorator;
2124
}
2225

@@ -72,7 +75,7 @@ - (void)processPrivacyError: (id<UADSError>)privacyError
7275
}
7376

7477
- (BOOL)shouldProceedWithTheCallForError: (id<UADSError>)error {
75-
return error.errorDomain == kPrivacyLoaderErrorDomain;
78+
return error.errorDomain == kPrivacyLoaderErrorDomain && ![_fastFailCodes containsObject: error.errorCode];
7679
}
7780

7881
@end

SourceCode/Private/Core/Configuration/SDKConfigurationReader/ConfigurationLoader/PrivacyLoader/UADSInitializationResponse.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
3434
@property (nonatomic, strong, readonly) NSDictionary *originalJSON;
3535
@property (nonatomic, assign) long responseCode;
3636
@property (nonatomic, assign) BOOL allowTracking;
37+
@property (nonatomic, assign) BOOL shouldSendNonBehavioural;
3738

3839
+ (instancetype)newFromDictionary: (NSDictionary *)dictionary;
3940

SourceCode/Private/Core/Configuration/SDKConfigurationReader/ConfigurationLoader/PrivacyLoader/UADSInitializationResponse.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ + (instancetype)newFromDictionary: (NSDictionary *)dictionary {
4040
response.originalJSON = dictionary;
4141

4242
response.allowTracking = [dictionary[@"pas"] boolValue] ? : false;
43+
response.shouldSendNonBehavioural = [dictionary[@"snb"] boolValue] ?: false;
4344
return response;
4445
}
4546

SourceCode/Private/Core/Configuration/SDKConfigurationReader/ConfigurationLoader/PrivacyLoader/UADSPrivacyLoader.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#import "UADSInitializationResponse.h"
33
#import "UADSGenericCompletion.h"
44
#import "USRVInitializationRequestFactory.h"
5+
#import "UADSErrorState.h"
6+
57
NS_ASSUME_NONNULL_BEGIN
68

79
typedef void (^UADSPrivacyCompletion)(UADSInitializationResponse *);
@@ -32,6 +34,11 @@ extern NSString *const kPrivacyLoaderErrorDomain;
3234
code: kUADSPrivacyLoaderInvalidResponseCode \
3335
userInfo: nil] \
3436

37+
#define uads_privacyGameDisabledError \
38+
[[NSError alloc] initWithDomain: kPrivacyLoaderErrorDomain \
39+
code: kPrivacyGameIdDisabledCode \
40+
userInfo: nil] \
41+
3542
@protocol UADSPrivacyLoader <NSObject>
3643
- (void)loadPrivacyWithSuccess: (UADSPrivacyCompletion)success
3744
andErrorCompletion: (UADSErrorCompletion)errorCompletion;

SourceCode/Private/Core/Configuration/SDKConfigurationReader/ConfigurationLoader/PrivacyLoader/UADSPrivacyLoader.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ - (void)makePrivacyRequestWithSuccess: (nonnull UADSPrivacyCompletion)success
6868
}
6969

7070
if (![request is2XXResponse]) {
71+
if (request.responseCode == 423) {
72+
errorCompletion(uads_privacyGameDisabledError);
73+
return;
74+
}
7175
errorCompletion(uads_privacyInvalidResponseCodeError);
7276
return;
7377
}

SourceCode/Private/Core/Configuration/SDKConfigurationReader/ConfigurationLoader/PrivacyLoader/UADSPrivacyStorage.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ NSString * uads_privacyResponseStateToString(UADSPrivacyResponseState);
2121
@protocol UADSPrivacyResponseReader <NSObject>
2222

2323
- (UADSPrivacyResponseState)responseState;
24+
- (BOOL)shouldSendUserNonBehavioral;
2425

2526
@end
2627

SourceCode/Private/Core/Configuration/SDKConfigurationReader/ConfigurationLoader/PrivacyLoader/UADSPrivacyStorage.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ - (void)saveResponse: (nonnull UADSInitializationResponse *)response {
3434
[self.mediator notifyObserversWithObjectAndRemove: response];
3535
}
3636

37+
- (BOOL)shouldSendUserNonBehavioral {
38+
return self.response.shouldSendNonBehavioural;
39+
}
40+
3741
- (UADSPrivacyResponseState)responseState {
3842
if (!self.response) {
3943
return kUADSPrivacyResponseUnknown;

0 commit comments

Comments
 (0)