Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mraid v2 #322

Merged
merged 36 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e69b80e
set screen size on ad loading & orientation change
Jul 31, 2023
b850b54
code clean up
Jul 31, 2023
d4ef03a
Merge branch 'main' into mraid/available-size-for-ad
Jul 31, 2023
445e069
js interaction
Jul 31, 2023
6ba11b5
send supported features to mraid bridge
Jul 31, 2023
f7d6c50
set supported features
Aug 1, 2023
59b7d9d
play video
Aug 9, 2023
9bf09e7
updated mock message handler
Aug 9, 2023
960c864
set ad position
Aug 7, 2023
c9dc3c2
Merge branch 'mraid/mraid-v2' into mraid/supports-method
Aug 9, 2023
4b66cf2
Merge branch 'mraid/mraid-v2' into mraid/available-size-for-ad
Aug 11, 2023
f0e1cfb
Merge branch 'mraid/mraid-v2' into mraid/play-video
Aug 11, 2023
313a17c
updated play video action type
Aug 11, 2023
ec6b818
removed inlineVideo feature from MRAID feature because it is set dire…
Aug 25, 2023
51483cf
resize ad action
Aug 22, 2023
5d80c61
additional validations for close are view
Aug 28, 2023
b977694
implemented a suit of tests for resize action
Aug 30, 2023
a0853ca
orientation properties - wip
Sep 14, 2023
2d838f5
orientation properties unit tests
Sep 19, 2023
5ba9187
code formatted
Sep 19, 2023
fe8298e
mraid 2 feature flag + updated bid request
Oct 16, 2023
5c1033b
updated failing test
Oct 17, 2023
964728d
added unit test for mraid 2 flag
Oct 17, 2023
50f2b75
Merge branch 'main' into mraid/mraid-v2
Nov 22, 2023
c111b94
fixed expand action when size is negative
Dec 7, 2023
c429670
orientation properties update
Dec 12, 2023
85cf899
updated resize action
Dec 13, 2023
a69ff47
updated resize to be able to resize from resized state, expand from r…
Dec 19, 2023
bab9f5f
Merge branch 'main' into mraid/mraid-v2
Dec 28, 2023
661beac
fixed on device orientation change handler
Dec 28, 2023
a62500b
updated podfile to use mraid 2.0.0
Dec 28, 2023
c861a10
code format fix
Jan 4, 2024
8a8db55
updated mraid resize tests
Jan 4, 2024
0d3d54d
updated mraid tests
Jan 8, 2024
90dde75
updated mraid handler tests
Jan 10, 2024
d951288
disabled testExpandMRAIDAction test
Jan 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ class AdViewerViewController: FormViewController {
self.updateAdConfig()
}

override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return .landscape
}

override var shouldAutorotate: Bool {
return false
}

private func advancedSection() -> Section {
Section("Advanced options") {
$0.hidden = .function(
Expand Down
78 changes: 73 additions & 5 deletions CriteoPublisherSdk/CriteoPublisherSdk.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion CriteoPublisherSdk/Sources/Configuration/CR_Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ FOUNDATION_EXTERN NSString *const CR_ConfigConfigurationUrl;
@property(nonatomic, readonly) NSString *configUrl;

#pragma mark - MRAID
@property(assign, nonatomic, getter=isMRAIDEnabled) BOOL mraidEnabled;
@property(assign, nonatomic, getter=isMraidEnabled) BOOL mraidEnabled;
@property(assign, nonatomic, getter=isMraid2Enabled) BOOL mraid2Enabled;
@property(nonatomic, readonly) BOOL isMRAIDGlobalEnabled;

#pragma mark - Lifecycle

Expand Down
12 changes: 12 additions & 0 deletions CriteoPublisherSdk/Sources/Configuration/CR_Config.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ - (instancetype)initWithCriteoPublisherId:(nullable NSString *)criteoPublisherId
_remoteLogLevel = [userDefaults cr_valueForRemoteLogLevel];
_userDefaults = userDefaults;
_mraidEnabled = [userDefaults cr_valueForMRAID];
_mraid2Enabled = [userDefaults cr_valueForMRAID2];
_isMRAIDGlobalEnabled = _mraidEnabled || _mraid2Enabled;
_storeId = storeId;
}
return self;
Expand Down Expand Up @@ -141,6 +143,16 @@ - (void)setRemoteLogLevel:(CR_LogSeverity)remoteLogLevel {
[self.userDefaults cr_setValueForRemoteLogLevel:remoteLogLevel];
}

- (void)setMraidEnabled:(BOOL)mraidEnabled {
_mraidEnabled = mraidEnabled;
[self.userDefaults cr_setValueForMRAID:mraidEnabled];
}

- (void)setMraid2Enabled:(BOOL)mraid2Enabled {
_mraid2Enabled = mraid2Enabled;
[self.userDefaults cr_setValueForMRAID2:mraid2Enabled];
}

+ (NSDictionary *)getConfigValuesFromData:(NSData *)data {
NSError *e = nil;
NSMutableDictionary *configValues = [NSJSONSerialization JSONObjectWithData:data
Expand Down
4 changes: 4 additions & 0 deletions CriteoPublisherSdk/Sources/Configuration/CR_ConfigManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ - (void)refreshConfig:(CR_Config *)config {
[configValues[@"mraidEnabled"] isKindOfClass:NSNumber.class]) {
config.mraidEnabled = ((NSNumber *)configValues[@"mraidEnabled"]).boolValue;
}
if (configValues[@"mraid2Enabled"] &&
[configValues[@"mraid2Enabled"] isKindOfClass:NSNumber.class]) {
config.mraid2Enabled = ((NSNumber *)configValues[@"mraid2Enabled"]).boolValue;
}
}];
}

Expand Down
Loading
Loading