Skip to content

Commit

Permalink
SDKv7.12
Browse files Browse the repository at this point in the history
* commit 'ad0d4df14c3d55109b0b7dee826487fb5f3748cf':
  SDK v7.12
  MS-4730 Viewabality Tracker not fired
  Added fix for OMID containerGeometry event
  MS-4727 Native Assembly Custom elements (YJ)
  Merge pull request #705 in MOBILE-SDK/app_mobile-sdk-ios from FixBannerVideoAd to develop
  fix for memory leak
  • Loading branch information
asharmaa committed Apr 16, 2021
2 parents 9516d23 + ad0d4df commit 8bcb2a2
Show file tree
Hide file tree
Showing 16 changed files with 124 additions and 29 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 = "7.11"
s.version = "7.12"
s.platform = :ios, "9.0"

s.summary = "AppNexus iOS Mobile Advertising SDK"
Expand Down
9 changes: 9 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 7.12
### Improvements/Bug Fixes
+ MS-4719 Disabled autoplay for HTML5 Banner Video Ads
+ MS-4731 Fixed issue with OutStream Video that was preventing videos from playing
+ MS-4730 Fixed issue with OMID Tracker not firing for BannerAds in some cases
+ MS-4704 Added support for OMID containerGeometry and onScreenContainerGeometry for Instream & OutStream Video Ads
+ MS-4727 Added support for custom assets in Native Assembly Renderer
+ MS-4729 Removed strong reference on views to avoid cyclic reference for NativeAds

## 7.11
### Improvements/Bug Fixes
+ MS-4714 Added improvement for Ad Expiry events for Native Ads.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/

#import <UIKit/UIKit.h>
#import <AppNexusSDK/AppNexusSDK.h>

@interface ANNativeAdView : UIView
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
Expand All @@ -23,4 +24,6 @@
@property (weak, nonatomic) IBOutlet UIButton *callToActionButton;
@property (weak, nonatomic) IBOutlet UILabel *sponsoredLabel;

@property (nonatomic, strong) ANNativeAdResponse *nativeResponse;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@

#import "ANNativeAdView.h"


@implementation ANNativeAdView

@synthesize nativeResponse = _nativeResponse;

-(void) setNativeResponse:(ANNativeAdResponse *)nativeAdResponse {
_nativeResponse = nativeAdResponse;
self.titleLabel.text = nativeAdResponse.title;
self.bodyLabel.text = nativeAdResponse.body;
self.iconImageView.image = nativeAdResponse.iconImage;
self.mainImageView.image = nativeAdResponse.mainImage;
self.sponsoredLabel.text = nativeAdResponse.sponsoredBy;
[self.callToActionButton setTitle:nativeAdResponse.callToAction forState:UIControlStateNormal];
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

@interface NativeAdViewController () <ANNativeAdRequestDelegate,ANNativeAdDelegate>
@property (nonatomic,readwrite,strong) ANNativeAdRequest *nativeAdRequest;
@property (nonatomic,readwrite,strong) ANNativeAdResponse *nativeAdResponse;
//@property (nonatomic,readwrite,strong) ANNativeAdResponse *nativeAdResponse;
@property (nonatomic,readwrite,strong) ANNativeAdView *nativeAdView;
@end

@implementation NativeAdViewController
Expand All @@ -31,37 +32,52 @@ - (void)viewDidLoad {

[ANLogManager setANLogLevel:ANLogLevelAll];


}

-(void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
self.nativeAdRequest= [[ANNativeAdRequest alloc] init];
self.nativeAdRequest.placementId = @"17058950";
self.nativeAdRequest.gender = ANGenderMale;
self.nativeAdRequest.shouldLoadIconImage = YES;
self.nativeAdRequest.shouldLoadMainImage = YES;
self.nativeAdRequest.delegate = self;
[self.nativeAdRequest loadAd];

}

-(void) viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
//self.nativeAdRequest = nil;
//self.nativeAdResponse = nil;
self.nativeAdView = nil;

}

- (void)adRequest:(ANNativeAdRequest *)request didReceiveResponse:(ANNativeAdResponse *)response {
// (code which loads the view)
self.nativeAdResponse = response;
ANNativeAdResponse *nativeAdResponse = response;

UINib *adNib = [UINib nibWithNibName:@"ANNativeAdView" bundle:[NSBundle mainBundle]];
NSArray *array = [adNib instantiateWithOwner:self options:nil];
ANNativeAdView *nativeAdView = [array firstObject];
nativeAdView.titleLabel.text = self.nativeAdResponse.title;
nativeAdView.bodyLabel.text = self.nativeAdResponse.body;
nativeAdView.iconImageView.image = self.nativeAdResponse.iconImage;
nativeAdView.mainImageView.image = self.nativeAdResponse.mainImage;
nativeAdView.sponsoredLabel.text = self.nativeAdResponse.sponsoredBy;
self.nativeAdView = [array firstObject];
self.nativeAdView.nativeResponse = response;
// self.nativeAdView.titleLabel.text = self.nativeAdResponse.title;
// self.nativeAdView.bodyLabel.text = self.nativeAdResponse.body;
// self.nativeAdView.iconImageView.image = self.nativeAdResponse.iconImage;
// self.nativeAdView.mainImageView.image = self.nativeAdResponse.mainImage;
// self.nativeAdView.sponsoredLabel.text = self.nativeAdResponse.sponsoredBy;

[nativeAdView.callToActionButton setTitle:self.nativeAdResponse.callToAction forState:UIControlStateNormal];
self.nativeAdResponse.delegate = self;
self.nativeAdResponse.clickThroughAction = ANClickThroughActionOpenDeviceBrowser;
// [self.nativeAdView.callToActionButton setTitle:self.nativeAdResponse.callToAction forState:UIControlStateNormal];
nativeAdResponse.delegate = self;
nativeAdResponse.clickThroughAction = ANClickThroughActionOpenDeviceBrowser;

[self.view addSubview:nativeAdView];
[self.view addSubview:self.nativeAdView];

[self.nativeAdResponse registerViewForTracking:nativeAdView
[nativeAdResponse registerViewForTracking:self.nativeAdView
withRootViewController:self
clickableViews:@[nativeAdView.callToActionButton,nativeAdView.mainImageView]
clickableViews:@[self.nativeAdView.callToActionButton,self.nativeAdView.mainImageView]
error:nil];

}
Expand Down
2 changes: 1 addition & 1 deletion sdk/AppNexusNativeSDK/SDK-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>7.11</string>
<string>7.12</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
Expand Down
2 changes: 1 addition & 1 deletion sdk/AppNexusSDK/SDK-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>7.11</string>
<string>7.12</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
50 changes: 49 additions & 1 deletion sdk/sourcefiles/Resources/nativeRenderer.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,55 @@
price: nObj.price,
salePrice: nObj.saleprice,
phone: nObj.phone,
address: nObj.address
address: nObj.address,

customTitle1: nObj.title1,
customTitle2: nObj.title2,
customTitle3: nObj.title3,
customTitle4: nObj.title4,
customTitle5: nObj.title5,

customBody1: nObj.body1,
customBody2: nObj.body2,
customBody3: nObj.body3,
customBody4: nObj.body4,
customBody5: nObj.body5,

customCta1: nObj.ctatext1,
customCta2: nObj.ctatext2,
customCta3: nObj.ctatext3,
customCta4: nObj.ctatext4,
customCta5: nObj.ctatext5,

customDisplayUrl1: nObj.displayurl1,
customDisplayUrl2: nObj.displayurl2,
customDisplayUrl3: nObj.displayurl3,
customDisplayUrl4: nObj.displayurl4,
customDisplayUrl5: nObj.displayurl5,

customSocialUrl1: nObj.socialurl1,
customSocialUrl2: nObj.socialurl2,
customSocialUrl3: nObj.socialurl3,
customSocialUrl4: nObj.socialurl4,
customSocialUrl5: nObj.socialurl5,

customImage1: nObj.image1,
customImage2: nObj.image2,
customImage3: nObj.image3,
customImage4: nObj.image4,
customImage5: nObj.image5,

customIcon1: nObj.icon1,
customIcon2: nObj.icon2,
customIcon3: nObj.icon3,
customIcon4: nObj.icon4,
customIcon5: nObj.icon5,

customSocialIcon1: nObj.socialicon1,
customSocialIcon2: nObj.socialicon2,
customSocialIcon3: nObj.socialicon3,
customSocialIcon4: nObj.socialicon4,
customSocialIcon5: nObj.socialicon5
};
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion sdk/sourcefiles/Resources/vastVideo.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<script src="sdkjs.js"></script>
<script src="omsdk.js"></script>
<script src="optionsparser.js"></script>
<div id="video-content" style="background-color:#000000"></div>
<div id="video-content" style="background-color:#000000" class="omid-element"></div>
<script>
var ua = getMobileOperatingSystem();
var targetId = "video-content";
Expand Down
4 changes: 3 additions & 1 deletion sdk/sourcefiles/internal/ANAdWebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ - (instancetype) initWithSize: (CGSize)size
[self handleMRAIDURL:[NSURL URLWithString:@"mraid://enable"]];

_webView = [[ANWebView alloc] initWithSize:size URL:[[[ANSDKSettings sharedInstance] baseUrlConfig] videoWebViewUrl]];

self.firstNavigation = _webView.navigation;
[self loadWebViewWithUserScripts];

UIWindow *currentWindow = [ANGlobal getKeyWindow];
Expand Down Expand Up @@ -237,6 +237,7 @@ + (NSString *)prependViewportToHTML:(NSString *)html
// return [NSString stringWithFormat:@"%@%@%@", [[self class] anjamHTML], [[self class] mraidHTML], html];
//}


#pragma mark - configure WKWebView

-(void) loadWebViewWithUserScripts {
Expand Down Expand Up @@ -526,6 +527,7 @@ - (void) userContentController: (WKUserContentController *)userContentController

- (void)processWebViewDidFinishLoad
{

if (!self.completedFirstLoad)
{
self.completedFirstLoad = YES;
Expand Down
11 changes: 6 additions & 5 deletions sdk/sourcefiles/internal/ANBannerAdView.m
Original file line number Diff line number Diff line change
Expand Up @@ -632,11 +632,11 @@ - (void)universalAdFetcher:(ANUniversalAdFetcher *)fetcher didFinishRequestWithR
// Fire trackers and OMID upon attaching to UIView hierarchy or if countImpressionOnAdReceived is enabled,
// but only when the AdUnit is not lazy.
//
if(!response.isLazy && self.valueOfHowImpressionBeFired == ANAdRendered && self.window){
if((!response.isLazy && self.valueOfHowImpressionBeFired == ANAdRendered && self.window) || self.valueOfHowImpressionBeFired == ANAdReceived){
self.contentView = adObject;
//fire impression tracker
[self fireTrackerAndOMID];
}

}
}

Expand All @@ -658,8 +658,10 @@ - (void)universalAdFetcher:(ANUniversalAdFetcher *)fetcher didFinishRequestWithR

// Handle AdUnit that is NOT lazy loaded.
//
self.contentView = adObject;

if(self.contentView == nil){
self.contentView = adObject;
}

if(self.isLazySecondPassThroughAdUnit && self.valueOfHowImpressionBeFired == ANLazyLoad){
[self fireTrackerAndOMID];
}
Expand Down Expand Up @@ -876,4 +878,3 @@ - (void) handle1SecTimerSentNotification {


@end

2 changes: 1 addition & 1 deletion sdk/sourcefiles/internal/ANGlobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define AN_ERROR_TABLE @"errors"

#define AN_DEFAULT_PLACEMENT_ID @"default_placement_id"
#define AN_SDK_VERSION @"7.11"
#define AN_SDK_VERSION @"7.12"


#define APPNEXUS_BANNER_SIZE CGSizeMake(320, 50)
Expand Down
3 changes: 3 additions & 0 deletions sdk/sourcefiles/internal/ANWebView.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@

+ (ANWebView *) fetchWebView;
+ (void) prepareWebView;

@property (nonatomic, readwrite, strong) WKNavigation *navigation;

@end
2 changes: 1 addition & 1 deletion sdk/sourcefiles/internal/ANWebView.m
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ -(instancetype) initWithSize:(CGSize)size URL:(NSURL *)URL
if (!self) { return nil; }

NSURLRequest *request = [NSURLRequest requestWithURL:URL];
[self loadRequest:request];
self.navigation = [self loadRequest:request];

return self;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@interface ANNativeAdResponse (PrivateMethods)

@property (nonatomic, readonly, weak) UIViewController *rootViewController;
@property (nonatomic, readonly, strong) UIView *viewForTracking;
@property (nonatomic, readonly, weak) UIView *viewForTracking;
@property (nonatomic, readonly, strong) OMIDAppnexusAdSession *omidAdSession;
@property (nonatomic, readwrite, strong) ANVerificationScriptResource *verificationScriptResource;
@property (nonatomic, readonly, strong) NSString *nativeRenderingUrl;
Expand Down
2 changes: 1 addition & 1 deletion sdk/sourcefiles/native/internal/ANNativeAdResponse.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ @implementation ANNativeAdResponseGestureRecognizerRecord

@interface ANNativeAdResponse()

@property (nonatomic, readwrite, strong) UIView *viewForTracking;
@property (nonatomic, readwrite, weak) UIView *viewForTracking;
@property (nonatomic, readwrite, strong) NSMutableArray *gestureRecognizerRecords;
@property (nonatomic, readwrite, weak) UIViewController *rootViewController;
@property (nonatomic, readwrite, assign, getter=hasExpired) BOOL expired;
Expand Down

0 comments on commit 8bcb2a2

Please sign in to comment.