Skip to content

Commit

Permalink
Merge pull request #885 in MOBILE-SDK/app_mobile-sdk-ios from release…
Browse files Browse the repository at this point in the history
…_branch_v8.5 to master

* commit 'f2d31855b2c1a390c6882f16dbc178abaa0e6861':
  8.5.0
  Merge pull request #881 in MOBILE-SDK/app_mobile-sdk-ios from MS-5227_outstream_ad_webview_config_update to develop
  Banner Video MultiAd Load
  • Loading branch information
KirubakarMuruganandam committed Mar 7, 2023
2 parents 682fd4c + f2d3185 commit af0f35c
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 16 deletions.
2 changes: 1 addition & 1 deletion AppNexusSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "AppNexusSDK"
s.version = "8.4.0"
s.version = "8.5.0"
s.platform = :ios, "10.0"

s.summary = "AppNexus iOS Mobile Advertising SDK"
Expand Down
5 changes: 5 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 8.5.0

### Improvement/Bug Fixes
+ MS-5227 Fixed issue with loading multiple outstream video ads simultaneously

## 8.4.0
Update version to match Android SDK. No changes from 8.3.0

Expand Down
12 changes: 6 additions & 6 deletions sdk/AppNexusSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1905,7 +1905,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 8.4.0;
MARKETING_VERSION = 8.5.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = Xandr.AppNexusNativeMacOSSDK;
Expand Down Expand Up @@ -1950,7 +1950,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 8.4.0;
MARKETING_VERSION = 8.5.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = Xandr.AppNexusNativeMacOSSDK;
Expand Down Expand Up @@ -1996,7 +1996,7 @@
"@loader_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = "";
MARKETING_VERSION = 8.4.0;
MARKETING_VERSION = 8.5.0;
MTL_ENABLE_DEBUG_INFO = YES;
PRODUCT_BUNDLE_IDENTIFIER = "corp.appnexus.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -2038,7 +2038,7 @@
"@loader_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = "";
MARKETING_VERSION = 8.4.0;
MARKETING_VERSION = 8.5.0;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = "corp.appnexus.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -2202,7 +2202,7 @@
"@loader_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = "";
MARKETING_VERSION = 8.4.0;
MARKETING_VERSION = 8.5.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = corp.appnexus.AppNexusSDK;
Expand Down Expand Up @@ -2253,7 +2253,7 @@
"@loader_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = "";
MARKETING_VERSION = 8.4.0;
MARKETING_VERSION = 8.5.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = corp.appnexus.AppNexusSDK;
Expand Down
2 changes: 1 addition & 1 deletion sdk/sourcefiles/internal/ANAdWebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ - (instancetype) initWithSize: (CGSize)size

[self handleMRAIDURL:[NSURL URLWithString:@"mraid://enable"]];

_webView = [[ANWebView alloc] initWithSize:size URL:[[[ANSDKSettings sharedInstance] baseUrlConfig] videoWebViewUrl]];
_webView = [[ANWebView alloc] initWithSize:size URL:[[[ANSDKSettings sharedInstance] baseUrlConfig] videoWebViewUrl] isVASTVideoAd:true];
self.firstNavigation = _webView.navigation;
[self loadWebViewWithUserScripts];

Expand Down
4 changes: 2 additions & 2 deletions sdk/sourcefiles/internal/ANGlobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@


#if !APPNEXUS_NATIVE_MACOS_SDK
#define AN_SDK_VERSION @"8.4.0"
#define AN_SDK_VERSION @"8.5.0"
#else
#define AN_SDK_VERSION @"8.4.0-mac"
#define AN_SDK_VERSION @"8.5.0-mac"
#endif


Expand Down
1 change: 1 addition & 0 deletions sdk/sourcefiles/internal/ANWebView.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
baseURL:(NSURL *)baseURL;

-(instancetype) initWithSize:(CGSize)size URL:(NSURL *)URL;
-(instancetype) initWithSize:(CGSize)size URL:(NSURL *)URL isVASTVideoAd:(BOOL)videoAd;

-(void) loadWithSize:(CGSize)size content:(NSString *) contentString baseURL:(NSURL *)baseURL;

Expand Down
33 changes: 27 additions & 6 deletions sdk/sourcefiles/internal/ANWebView.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,22 @@

NSMutableArray<ANWebView *> *webViewQueue;

@interface ANWebView ()
@property (nonatomic, readwrite, assign) BOOL isVASTVideoAd;
@end


@implementation ANWebView

-(instancetype) initWithSize:(CGSize)size
{
[[self class] loadWebViewConfigurations];

WKWebViewConfiguration *configuration = [[self class] webConfiguration];
WKWebViewConfiguration *configuration;
if(self.isVASTVideoAd){
configuration = [[self class] prepareWebConfiguration];
}else{
configuration = [[self class] webConfiguration];
}

self = [super initWithFrame:CGRectMake(0, 0, size.width, size.height) configuration:configuration];
if (!self) { return nil; }
Expand Down Expand Up @@ -91,7 +100,12 @@ -(instancetype) initWithSize:(CGSize)size content:(NSString *)htmlContent baseUR
[self loadHTMLString:htmlContent baseURL:baseURL];
return self;
}


-(instancetype) initWithSize:(CGSize)size URL:(NSURL *)URL isVASTVideoAd:(BOOL)videoAd {
self.isVASTVideoAd = videoAd;
return [self initWithSize:size URL:URL];
}

-(instancetype) initWithSize:(CGSize)size URL:(NSURL *)URL
{
self = [self initWithSize:size];
Expand Down Expand Up @@ -148,18 +162,23 @@ -(void) loadWebViewWithUserScripts {

+ (void) addDefaultWebViewConfiguration
{
configuration = [self prepareWebConfiguration];
}


+(WKWebViewConfiguration *)prepareWebConfiguration {
static dispatch_once_t processPoolToken;
static WKProcessPool *anSdkProcessPool;

dispatch_once(&processPoolToken, ^{
anSdkProcessPool = [[WKProcessPool alloc] init];
});

configuration = [[WKWebViewConfiguration alloc] init];
WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init];

configuration.processPool = anSdkProcessPool;
configuration.allowsInlineMediaPlayback = YES;

if (@available(iOS 10.0, *)) {
configuration.requiresUserActionForMediaPlayback = NO;
configuration.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAudio;
Expand All @@ -174,7 +193,7 @@ + (void) addDefaultWebViewConfiguration
configuration.requiresUserActionForMediaPlayback = YES;
}
}

WKUserContentController *controller = [[WKUserContentController alloc] init];
configuration.userContentController = controller;

Expand Down Expand Up @@ -212,8 +231,10 @@ + (void) addDefaultWebViewConfiguration
[controller addUserScript:execCurrentPositionDeniedScript];

}
return configuration;
}


+ (void) loadWebViewConfigurations {
if(mraidScript == nil){
mraidScript = [[WKUserScript alloc] initWithSource: [[self class] mraidJS]
Expand Down

0 comments on commit af0f35c

Please sign in to comment.