Skip to content

Commit

Permalink
SDKv7.9
Browse files Browse the repository at this point in the history
* commit 'a1715daaa7b39d97219cb65d5b106e229329b070':
  v7.9
  Admob Update v7.69.0
  Fetch SDK Version dynamically
  API to disable Device
  Fixed Unit Testcase
  Facebook v6.2.1
  added logs
  removed unwanted files
  added code
  moved the API to universalAdFetcher
  modified logic to support CSM & SSM
  added observerer code that was missed out
  Merge pull request #659 in MOBILE-SDK/app_mobile-sdk-ios from MS-4534_DeprecateAPI to develop
  change to fire trackers closer to creating webviews
  removed load logic from ANGlobal
  modified tests
  remove sample changes
  remove unwanted files
  modified user agent logic
  modify user agent logic
  • Loading branch information
asharmaa committed Jan 28, 2021
2 parents ec9e7c3 + a1715da commit 8bf747d
Show file tree
Hide file tree
Showing 38 changed files with 450 additions and 215 deletions.
10 changes: 5 additions & 5 deletions 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.8"
s.version = "7.9"
s.platform = :ios, "9.0"

s.summary = "AppNexus iOS Mobile Advertising SDK"
Expand All @@ -22,30 +22,30 @@ DESC
s.subspec 'AppNexusSDK' do |subspec|
subspec.source_files = "sdk/sourcefiles/**/*.{h,m}"
subspec.public_header_files = "sdk/sourcefiles/*.h","sdk/sourcefiles/native/*.h"
subspec.resources = "sdk/sourcefiles/**/*.{png,bundle,xib,nib,js,html,strings}"
subspec.resources = "sdk/sourcefiles/**/*.{png,bundle,xib,nib,js,html,strings}","sdk/AppNexusSDK/SDK-Info.plist"
subspec.vendored_frameworks = "sdk/sourcefiles/Viewability/OMSDK_Appnexus.framework"
subspec.frameworks = 'WebKit'
end

s.subspec 'GoogleAdapter' do |subspec|
subspec.dependency 'AppNexusSDK/AppNexusSDK', "#{s.version}"
subspec.dependency 'Google-Mobile-Ads-SDK', '7.67.0'
subspec.dependency 'Google-Mobile-Ads-SDK', '7.69.0'
subspec.source_files = "mediation/mediatedviews/GoogleAdMob/*.{h,m}"
subspec.public_header_files = "mediation/mediatedviews/GoogleAdMob/ANAdAdapterNativeAdMob.h"
subspec.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '${PODS_ROOT}/Google-Mobile-Ads-SDK/**' }
end

s.subspec 'FacebookCSRAdapter' do |subspec|
subspec.dependency 'AppNexusSDK/AppNexusSDK', "#{s.version}"
subspec.dependency 'FBAudienceNetwork', '6.2.0'
subspec.dependency 'FBAudienceNetwork', '6.2.1'
subspec.source_files = "csr/Facebook/*.{h,m}"
subspec.public_header_files = "csr/Facebook/*.h"
subspec.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '${PODS_ROOT}/FBAudienceNetwork/**' }
end

s.subspec 'FacebookAdapter' do |subspec|
subspec.dependency 'AppNexusSDK/AppNexusSDK', "#{s.version}"
subspec.dependency 'FBAudienceNetwork', '6.2.0'
subspec.dependency 'FBAudienceNetwork', '6.2.1'
subspec.source_files = "mediation/mediatedviews/Facebook/*.{h,m}"
subspec.public_header_files = "mediation/mediatedviews/Facebook/ANAdAdapterNativeFacebook.h"
subspec.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '${PODS_ROOT}/FBAudienceNetwork/**' }
Expand Down
10 changes: 10 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 7.9
### New Feature
+ MS-4388 Support to disable passing device IDs in bid requests
### Mediation partner updates
+ MS-4663 Upgraded Google AdMob SDK from v7.67.0 to v7.69.0
+ MS-4664 Upgraded Facebook SDK from v6.2.0 to v6.2.1
### Improvements/Bug Fixes
+ MS-3911 Fetch SDK Version Dynamically in ad request


## 7.8
### New Feature
+ MS-4387 Added support to pass traffic source and external inventory codes in Ad Request [https://wiki.xandr.com/x/5gEYBw]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<string>corp.appnexus.AppNexusSDK</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<string>7.9</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
Expand Down
20 changes: 10 additions & 10 deletions sdk/AppNexusSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,9 @@
0E9F613420FFDC3B009AECD8 /* ANNativeMediatedAdResponse+PrivateMethods.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ANNativeMediatedAdResponse+PrivateMethods.h"; sourceTree = "<group>"; };
0EA0790A2328E05200FB5764 /* OMSDK_Appnexus.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = OMSDK_Appnexus.framework; sourceTree = "<group>"; };
0ECF335D22D79A61007DB185 /* AppNexusNativeSDK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppNexusNativeSDK.h; sourceTree = "<group>"; };
0ECF335E22D79A61007DB185 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
0ECF335E22D79A61007DB185 /* SDK-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "SDK-Info.plist"; sourceTree = "<group>"; };
0ECF336022D79A62007DB185 /* AppNexusSDK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppNexusSDK.h; sourceTree = "<group>"; };
0ECF336122D79A62007DB185 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
0ECF336122D79A62007DB185 /* SDK-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "SDK-Info.plist"; sourceTree = "<group>"; };
0EEE97DA21764ACD007DADE6 /* omsdk.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = omsdk.js; sourceTree = "<group>"; };
381A0181245B17850093EBB2 /* ANAudioVolumeChangeListener.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ANAudioVolumeChangeListener.h; sourceTree = "<group>"; };
381A0182245B17850093EBB2 /* ANAudioVolumeChangeListener.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ANAudioVolumeChangeListener.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -702,7 +702,7 @@
isa = PBXGroup;
children = (
0ECF335D22D79A61007DB185 /* AppNexusNativeSDK.h */,
0ECF335E22D79A61007DB185 /* Info.plist */,
0ECF335E22D79A61007DB185 /* SDK-Info.plist */,
);
path = AppNexusNativeSDK;
sourceTree = "<group>";
Expand All @@ -711,7 +711,7 @@
isa = PBXGroup;
children = (
0ECF336022D79A62007DB185 /* AppNexusSDK.h */,
0ECF336122D79A62007DB185 /* Info.plist */,
0ECF336122D79A62007DB185 /* SDK-Info.plist */,
);
path = AppNexusSDK;
sourceTree = "<group>";
Expand Down Expand Up @@ -1502,7 +1502,7 @@
);
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
HEADER_SEARCH_PATHS = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include;
INFOPLIST_FILE = AppNexusSDK/Info.plist;
INFOPLIST_FILE = "AppNexusSDK/SDK-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
Expand Down Expand Up @@ -1539,7 +1539,7 @@
GCC_PREPROCESSOR_DEFINITIONS = "";
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
HEADER_SEARCH_PATHS = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include;
INFOPLIST_FILE = AppNexusSDK/Info.plist;
INFOPLIST_FILE = "AppNexusSDK/SDK-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
Expand Down Expand Up @@ -1691,15 +1691,15 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = AppNexusNativeSDK/Info.plist;
INFOPLIST_FILE = "AppNexusNativeSDK/SDK-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = "";
MARKETING_VERSION = 7.8;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.appnexus.AppNexusNativeSDK;
PRODUCT_BUNDLE_IDENTIFIER = corp.appnexus.AppNexusSDK;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -1736,15 +1736,15 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = AppNexusNativeSDK/Info.plist;
INFOPLIST_FILE = "AppNexusNativeSDK/SDK-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = "";
MARKETING_VERSION = 7.8;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.appnexus.AppNexusNativeSDK;
PRODUCT_BUNDLE_IDENTIFIER = corp.appnexus.AppNexusSDK;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
4 changes: 2 additions & 2 deletions sdk/AppNexusSDK/Info.plist → sdk/AppNexusSDK/SDK-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<string>corp.appnexus.AppNexusSDK</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<string>7.9</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
5 changes: 5 additions & 0 deletions sdk/sourcefiles/ANSDKSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,9 @@ An AppNexus geoOverrideZipCode is a string value which allows publishers to ove
*/
@property (nonatomic, readwrite, strong, nullable) NSString *geoOverrideZipCode;

/**
An AppNexus disableIDFAUsage is a boolean value which exclude the IDFA field in ad request. Default value of disableIDFAUsage is set to NO
*/
@property (nonatomic, readwrite) BOOL disableIDFAUsage;

@end
4 changes: 2 additions & 2 deletions sdk/sourcefiles/Viewability/ANOMIDImplementation.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ - (void) activateOMIDandCreatePartner

// This Creates / updates a partner for each new activation of OMID SDK
self.partner = [[OMIDAppnexusPartner alloc] initWithName: AN_OMIDSDK_PARTNER_NAME
versionString: AN_SDK_VERSION];
versionString: [[ANSDKSettings sharedInstance] sdkVersion]];
}

// IF partener is nil create partner
if(!self.partner){
self.partner = [[OMIDAppnexusPartner alloc] initWithName: AN_OMIDSDK_PARTNER_NAME
versionString: AN_SDK_VERSION];
versionString: [[ANSDKSettings sharedInstance] sdkVersion]];
}

// If OMID JS is empty fetch OMIDJS.
Expand Down
19 changes: 10 additions & 9 deletions sdk/sourcefiles/internal/ANANJAMImplementation.m
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,16 @@ + (void)callDispatchAppEvent:(ANAdWebViewController *)controller query:(NSDictio
// Get Device ID

+ (void)callGetDeviceID:(ANAdWebViewController *)controller query:(NSDictionary *)query {
NSString *cb = [query valueForKey:@"cb"];

// send idName:idfa, id: idfa value
NSDictionary *paramsList = @{
kANKeyCaller: kANCallGetDeviceID,
@"idname": @"idfa",
@"id": ANAdvertisingIdentifier()
};
[ANANJAMImplementation loadResult:controller cb:cb paramsList:paramsList];

NSString *idfa = ANAdvertisingIdentifier();
NSString *cb = [query valueForKey:@"cb"];
// send idName:idfa, id: idfa value
NSDictionary *paramsList = @{
kANKeyCaller: kANCallGetDeviceID,
@"idname": @"idfa",
@"id": (idfa ? idfa : @"")
};
[ANANJAMImplementation loadResult:controller cb:cb paramsList:paramsList];
}

// Get Custom Keywords
Expand Down
1 change: 1 addition & 0 deletions sdk/sourcefiles/internal/ANAdViewInternalDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

- (BOOL)valueOfEnableLazyLoad;
- (BOOL)valueOfIsLazySecondPassThroughAdUnit;
- (BOOL) valueOfCountImpressionOnAdReceived;

@required
- (void)adRequestFailedWithError:(NSError *)error andAdResponseInfo:(ANAdResponseInfo *)adResponseInfo;
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 @@ -738,7 +738,7 @@ - (void)updateWebViewOnAudioVolumeChange:(NSNumber *)volumePercentage {

- (void)updateCurrentAppOrientation {

UIInterfaceOrientation currentAppOrientation = [[UIApplication sharedApplication] statusBarOrientation];
UIInterfaceOrientation currentAppOrientation = ANStatusBarOrientation();
NSString *currentAppOrientationString = (UIInterfaceOrientationIsPortrait(currentAppOrientation)) ? kANPortrait : kANLandscape;

NSArray *supportedOrientations = [[[NSBundle mainBundle] infoDictionary]
Expand Down
12 changes: 9 additions & 3 deletions sdk/sourcefiles/internal/ANBannerAdView.m
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,12 @@ - (void)setEnableLazyLoad:(BOOL)booleanValue

- (void)fireTrackerAndOMID
{
[ANTrackerManager fireTrackerURLArray:self.impressionURLs withBlock:nil];
self.impressionURLs = nil;
if(self.impressionURLs != nil) {
//this check is needed to know if the impression was fired early or when attached to window. if impressionURL is nil then either it was fired early & removed or there was no urls in the response
ANLogDebug(@"Impression URL fired when adview is attaching to window");
[ANTrackerManager fireTrackerURLArray:self.impressionURLs withBlock:nil];
self.impressionURLs = nil;
}

// Fire OMID - Impression event only for AppNexus WKWebview TRUE for RTB and SSM
//
Expand Down Expand Up @@ -812,7 +816,9 @@ - (BOOL)valueOfIsLazySecondPassThroughAdUnit
return self.isLazySecondPassThroughAdUnit;
}


- (BOOL) valueOfCountImpressionOnAdReceived {
return self.countImpressionOnAdReceived;
}


#pragma mark - UIView observer methods.
Expand Down
22 changes: 18 additions & 4 deletions sdk/sourcefiles/internal/ANBrowserViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ - (BOOL)shouldStartLoadWithRequest:(NSURLRequest *)request {
- (void)viewWillLayoutSubviews {
CGFloat containerViewDistanceToTopOfSuperview;
if ([self respondsToSelector:@selector(modalPresentationCapturesStatusBarAppearance)]) {
CGSize statusBarFrameSize = [[UIApplication sharedApplication] statusBarFrame].size;
CGSize statusBarFrameSize = ANStatusBarFrame().size;
containerViewDistanceToTopOfSuperview = statusBarFrameSize.height;
if (statusBarFrameSize.height > statusBarFrameSize.width) {
containerViewDistanceToTopOfSuperview = statusBarFrameSize.width;
Expand Down Expand Up @@ -270,7 +270,13 @@ - (void)refreshToolbarActivityIndicator {

- (UIBarButtonItem *)refreshIndicatorItem {
if (!_refreshIndicatorItem) {
UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
UIActivityIndicatorView *indicator;
if (@available(iOS 13.0, *))
{
indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleMedium];
} else {
indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
}
[indicator startAnimating];
_refreshIndicatorItem = [[UIBarButtonItem alloc] initWithCustomView:indicator];
}
Expand Down Expand Up @@ -444,9 +450,17 @@ + (WKWebViewConfiguration *)defaultWebViewConfiguration {
// See: https://bugs.webkit.org/show_bug.cgi?id=147512
if ([[NSProcessInfo processInfo] respondsToSelector:@selector(isOperatingSystemAtLeastVersion:)] &&
[[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){10,0,0}]) {
configuration.requiresUserActionForMediaPlayback = NO;
if (@available(iOS 10.0, *)) {
configuration.mediaTypesRequiringUserActionForPlayback = NO;
}else {
configuration.requiresUserActionForMediaPlayback = NO;
}
} else {
configuration.requiresUserActionForMediaPlayback = YES;
if (@available(iOS 10.0, *)) {
configuration.mediaTypesRequiringUserActionForPlayback = YES;
}else {
configuration.requiresUserActionForMediaPlayback = YES;
}
}

return configuration;
Expand Down
10 changes: 6 additions & 4 deletions 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.8"
#define AN_SDK_VERSION @"7.9"


#define APPNEXUS_BANNER_SIZE CGSizeMake(320, 50)
Expand Down Expand Up @@ -112,7 +112,7 @@ BOOL ANAdvertisingTrackingEnabled(void);
BOOL ANIsFirstLaunch(void);

NSString * __nonnull ANUUID(void);
NSString *__nonnull ANAdvertisingIdentifier(void);
NSString *__nullable ANAdvertisingIdentifier(void);

NSString *__nonnull ANErrorString( NSString * __nonnull key);
NSError *__nonnull ANError(NSString *__nonnull key, NSInteger code, ...) NS_FORMAT_FUNCTION(1,3);
Expand All @@ -129,7 +129,9 @@ CGRect ANPortraitScreenBoundsApplyingSafeAreaInsets(void);
NSURLRequest * __nonnull ANBasicRequestWithURL(NSURL * __nonnull URL);
NSNumber * __nullable ANiTunesIDForURL(NSURL * __nonnull URL);
BOOL ANCanPresentFromViewController(UIViewController * __nullable viewController);

CGRect ANStatusBarFrame(void);
BOOL ANStatusBarHidden(void);
UIInterfaceOrientation ANStatusBarOrientation(void);

#pragma mark - Global class.

Expand All @@ -145,7 +147,7 @@ BOOL ANCanPresentFromViewController(UIViewController * __nullable viewController

+ (ANAdType) adTypeStringToEnum:(nonnull NSString *)adTypeString;

+ (nonnull NSString *) getUserAgent;
+ (nonnull NSString *) userAgent;

+ (nonnull UIWindow *) getKeyWindow;

Expand Down
Loading

0 comments on commit 8bf747d

Please sign in to comment.