Skip to content

Commit

Permalink
Merge branch 'master' of ssh://stash.corp.appnexus.com:7999/mobile-sd…
Browse files Browse the repository at this point in the history
…k/app_mobile-sdk-ios
  • Loading branch information
asharmaa committed Feb 28, 2020
2 parents 2d5ab75 + 47fc366 commit 1efa18b
Show file tree
Hide file tree
Showing 70 changed files with 2,163 additions and 375 deletions.
4 changes: 2 additions & 2 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.0"
s.version = "7.1"
s.platform = :ios, "9.0"

s.summary = "AppNexus iOS Mobile Advertising SDK"
Expand Down Expand Up @@ -29,7 +29,7 @@ DESC

s.subspec 'GoogleAdapter' do |subspec|
subspec.dependency 'AppNexusSDK/AppNexusSDK', "#{s.version}"
subspec.dependency 'Google-Mobile-Ads-SDK', '7.50.0'
subspec.dependency 'Google-Mobile-Ads-SDK', '7.55.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/**' }
Expand Down
14 changes: 14 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## 7.1
### New Feature
+ MS-3956 Added ANAdResponseInfo to return associated data with Ad response

### Mediation partner upgrade
+ Google AdMob SDK v7.55.0

### Improvements/Bug Fixes
+ MS-3882 Added option to include "publisher_id" in Ad request
+ MS-3896 Fixed bug on Interstitial Video Ad close feature
+ MS-4166 Fixed VideoAd OMID session tracker firing bug



## 7.0

### New Feature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ - (void)adView:(GADBannerView *)view didFailToReceiveAdWithError:(GADRequestErro
case kGADErrorTimeout:
code = ANAdResponseNetworkError;
break;
case kGADErrorInterstitialAlreadyUsed:
case kGADErrorAdAlreadyUsed:
code = ANAdResponseInternalError;
break;
case kGADErrorMediationDataError:
Expand Down
2 changes: 1 addition & 1 deletion mediation/mediatedviews/GoogleAdMob/ANAdAdapterBannerDFP.m
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ - (void)adView:(GADBannerView *)view didFailToReceiveAdWithError:(GADRequestErro
case kGADErrorTimeout:
code = ANAdResponseNetworkError;
break;
case kGADErrorInterstitialAlreadyUsed:
case kGADErrorAdAlreadyUsed:
code = ANAdResponseInternalError;
break;
case kGADErrorMediationDataError:
Expand Down
2 changes: 1 addition & 1 deletion mediation/mediatedviews/GoogleAdMob/ANAdAdapterBaseDFP.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ + (ANAdResponseCode)responseCodeFromRequestError:(GADRequestError *)error {
case kGADErrorTimeout:
code = ANAdResponseNetworkError;
break;
case kGADErrorInterstitialAlreadyUsed:
case kGADErrorAdAlreadyUsed:
code = ANAdResponseInternalError;
break;
case kGADErrorMediationDataError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ - (void)interstitial:(GADInterstitial *)ad didFailToReceiveAdWithError:(GADReque
case kGADErrorTimeout:
code = ANAdResponseNetworkError;
break;
case kGADErrorInterstitialAlreadyUsed:
case kGADErrorAdAlreadyUsed:
code = ANAdResponseInternalError;
break;
case kGADErrorMediationDataError:
Expand Down Expand Up @@ -120,6 +120,10 @@ - (void)interstitialWillPresentScreen:(GADInterstitial *)ad {
[self.delegate willPresentAd];
}

- (void)interstitialDidFailToPresentScreen:(nonnull GADInterstitial *)ad{
[self.delegate failedToDisplayAd];
}

- (void)interstitialWillDismissScreen:(GADInterstitial *)ad {
[self.delegate willCloseAd];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ - (void)interstitial:(GADInterstitial *)ad didFailToReceiveAdWithError:(GADReque
case kGADErrorTimeout:
code = ANAdResponseNetworkError;
break;
case kGADErrorInterstitialAlreadyUsed:
case kGADErrorAdAlreadyUsed:
code = ANAdResponseInternalError;
break;
case kGADErrorMediationDataError:
Expand Down
8 changes: 6 additions & 2 deletions sdk/AppNexusNativeSDK/AppNexusNativeSDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,22 @@ FOUNDATION_EXPORT const unsigned char AppNexusNativeSDKVersionString[];

#import <AppNexusNativeSDK/ANAdConstants.h>
#import <AppNexusNativeSDK/ANAdProtocol.h>
#import <AppNexusNativeSDK/ANLocation.h>
#import <AppNexusNativeSDK/ANSDKSettings.h>
#import <AppNexusNativeSDK/ANLogManager.h>
#import <AppNexusNativeSDK/ANLogging.h>

#import <AppNexusNativeSDK/ANLocation.h>
#import <AppNexusNativeSDK/ANTargetingParameters.h>
#import <AppNexusNativeSDK/ANSDKSettings.h>

#import <AppNexusNativeSDK/ANNativeAdDelegate.h>
#import <AppNexusNativeSDK/ANNativeAdRequest.h>
#import <AppNexusNativeSDK/ANNativeAdResponse.h>
#import <AppNexusNativeSDK/ANNativeAdStarRating.h>
#import <AppNexusNativeSDK/ANNativeCustomAdapter.h>
#import <AppNexusNativeSDK/ANNativeMediatedAdResponse.h>

#import <AppNexusNativeSDK/ANAdResponseInfo.h>

#import <AppNexusNativeSDK/ANGDPRSettings.h>
#import <AppNexusNativeSDK/ANUSPrivacySettings.h>

Expand Down
12 changes: 12 additions & 0 deletions sdk/AppNexusSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@
8AFC046F1A2E75AE00BEA485 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8AFC046E1A2E75AE00BEA485 /* AdSupport.framework */; };
8AFC04711A2E760800BEA485 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8AFC04701A2E760800BEA485 /* MessageUI.framework */; };
8AFC04731A2E78E400BEA485 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8AFC04721A2E78E400BEA485 /* StoreKit.framework */; };
9706554F232B93A200D484D4 /* ANAdResponseInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 9706554D232B93A200D484D4 /* ANAdResponseInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
97065550232B93A200D484D4 /* ANAdResponseInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 9706554D232B93A200D484D4 /* ANAdResponseInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
97065551232B93A200D484D4 /* ANAdResponseInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 9706554E232B93A200D484D4 /* ANAdResponseInfo.m */; };
97065552232B93A200D484D4 /* ANAdResponseInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 9706554E232B93A200D484D4 /* ANAdResponseInfo.m */; };
972025CE222FD90E00C13454 /* ANVerificationScriptResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 97EC51EB2229782B00B740DF /* ANVerificationScriptResource.h */; settings = {ATTRIBUTES = (Private, ); }; };
973B23AB238D1E4C00717D67 /* ANUSPrivacySettings.h in Headers */ = {isa = PBXBuildFile; fileRef = 973B23A9238D1E4C00717D67 /* ANUSPrivacySettings.h */; settings = {ATTRIBUTES = (Public, ); }; };
973B23AC238D1E4C00717D67 /* ANUSPrivacySettings.h in Headers */ = {isa = PBXBuildFile; fileRef = 973B23A9238D1E4C00717D67 /* ANUSPrivacySettings.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -522,6 +526,8 @@
8AFC046E1A2E75AE00BEA485 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; };
8AFC04701A2E760800BEA485 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; };
8AFC04721A2E78E400BEA485 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
9706554D232B93A200D484D4 /* ANAdResponseInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ANAdResponseInfo.h; sourceTree = "<group>"; };
9706554E232B93A200D484D4 /* ANAdResponseInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ANAdResponseInfo.m; sourceTree = "<group>"; };
973B23A9238D1E4C00717D67 /* ANUSPrivacySettings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ANUSPrivacySettings.h; sourceTree = "<group>"; };
973B23AA238D1E4C00717D67 /* ANUSPrivacySettings.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ANUSPrivacySettings.m; sourceTree = "<group>"; };
97A590D2228EBBD600D1C75C /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -638,6 +644,7 @@
00D6B04320D1BAB9007A3439 /* Viewability */,
8ABB76691A00385C00FEAD9D /* ANAdConstants.h */,
ECE4EA8D194B768A0069D934 /* ANAdProtocol.h */,
9706554D232B93A200D484D4 /* ANAdResponseInfo.h */,
ECE4EA8E194B768A0069D934 /* ANAdView.h */,
ECE4EA8F194B768A0069D934 /* ANBannerAdView.h */,
ECE4EA90194B768A0069D934 /* ANCustomAdapter.h */,
Expand Down Expand Up @@ -801,6 +808,7 @@
4FE7CE781F2FD6A100A5044A /* universalTag */,
4F131E8A1F71CCE50019FDAC /* ANAdFetcherResponse.h */,
4F131E8B1F71CCE50019FDAC /* ANAdFetcherResponse.m */,
9706554E232B93A200D484D4 /* ANAdResponseInfo.m */,
8AD618A41981C11F00AC0780 /* ANAdView.m */,
8AD618A51981C11F00AC0780 /* ANAdViewInternalDelegate.h */,
8AC7C5361A3B5CEF00AA5548 /* ANAdWebViewController.h */,
Expand Down Expand Up @@ -978,6 +986,7 @@
006F6B9E2295F72A003D2DF0 /* ANAdFetcherBase.h in Headers */,
607A21141F85557E00BD8353 /* ANAdFetcherResponse.h in Headers */,
8A9AEDB21A1BE8C200C58BDA /* ANAdProtocol.h in Headers */,
9706554F232B93A200D484D4 /* ANAdResponseInfo.h in Headers */,
8AE5E11E1A2FDC7700FDE858 /* ANAdView+PrivateMethods.h in Headers */,
8A9AEDB31A1BE8C200C58BDA /* ANAdView.h in Headers */,
8A9AEDCE1A1BF88200C58BDA /* ANAdViewInternalDelegate.h in Headers */,
Expand Down Expand Up @@ -1070,6 +1079,7 @@
4F06400923A2E7DC00E7920A /* ANAdFetcherBase.h in Headers */,
F5731B7A228C94720012B134 /* ANAdFetcherResponse.h in Headers */,
F5731BBE228C99BC0012B134 /* ANAdProtocol.h in Headers */,
97065550232B93A200D484D4 /* ANAdResponseInfo.h in Headers */,
F5731B5D228C8DF50012B134 /* ANBaseAdObject.h in Headers */,
F5731B6B228C8E3E0012B134 /* ANBaseUrlConfig.h in Headers */,
F5731B81228C94C70012B134 /* ANBrowserViewController.h in Headers */,
Expand Down Expand Up @@ -1277,6 +1287,7 @@
files = (
006F6B9B2295F70E003D2DF0 /* ANAdFetcherBase.m in Sources */,
607A20FE1F85540800BD8353 /* ANAdFetcherResponse.m in Sources */,
97065551232B93A200D484D4 /* ANAdResponseInfo.m in Sources */,
8A9AEDF01A1BF99D00C58BDA /* ANAdView.m in Sources */,
8AE7AD9F1A7AC4F6009E2F2F /* ANAdWebViewController.m in Sources */,
8A9AEDF21A1BF99D00C58BDA /* ANANJAMImplementation.m in Sources */,
Expand Down Expand Up @@ -1357,6 +1368,7 @@
files = (
4F06400823A2E7D700E7920A /* ANAdFetcherBase.m in Sources */,
F5731B79228C94700012B134 /* ANAdFetcherResponse.m in Sources */,
97065552232B93A200D484D4 /* ANAdResponseInfo.m in Sources */,
F5731B5E228C8DFA0012B134 /* ANBaseAdObject.m in Sources */,
F5731B82228C94CC0012B134 /* ANBrowserViewController.m in Sources */,
F5731B56228C8DD50012B134 /* ANCarrierObserver.m in Sources */,
Expand Down
1 change: 1 addition & 0 deletions sdk/AppNexusSDK/AppNexusSDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ FOUNDATION_EXPORT const unsigned char AppNexusSDKVersionString[];
#import <AppNexusSDK/ANNativeMediatedAdResponse.h>

#import <AppNexusSDK/ANMultiAdRequest.h>
#import <AppNexusSDK/ANAdResponseInfo.h>

#import <AppNexusSDK/ANGDPRSettings.h>
#import <AppNexusSDK/ANUSPrivacySettings.h>
2 changes: 1 addition & 1 deletion sdk/AppNexusSDK/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.0</string>
<string>7.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
20 changes: 17 additions & 3 deletions sdk/sourcefiles/ANAdProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#import "ANAdConstants.h"
#import "ANLocation.h"

#import "ANAdResponseInfo.h"

@class ANLocation;

Expand All @@ -43,6 +43,11 @@
*/
@property (nonatomic, readonly, assign) NSInteger memberId;

/**
* A publisher ID associates this member with a publisher.
*/
@property (nonatomic, readwrite, assign) NSInteger publisherId;

/**
The user's location. See ANLocation.h in this directory for
details.
Expand Down Expand Up @@ -142,7 +147,7 @@
Report the Ad Type of the returned ad object.
Not available until load is complete and successful.
*/
@property (nonatomic, readwrite) ANAdType adType;
@property (nonatomic, readwrite) ANAdType adType DEPRECATED_MSG_ATTRIBUTE("Use ANAdResponse instead.");

/**
Set the inventory code and member id for the place that ads will be shown.
Expand Down Expand Up @@ -223,7 +228,16 @@
An AppNexus creativeID for the current creative that is displayed
*/
// CreativeId should be accessible from response Object only(like. ANBannerAdView, ANInterstitialAd, ANInstreamVideoAd and ANNativeAdResponse). It is placed into ANAdProtocol instead of ANAdProtocolFoundation to avoid creativeID being accessed through ANNativeAdRequest.
@property (nonatomic, readonly, strong, nullable) NSString *creativeId;
@property (nonatomic, readonly, strong, nullable) NSString *creativeId DEPRECATED_MSG_ATTRIBUTE("Use ANAdResponse instead.");


/**
* An AppNexus Single Unified object that will contain all the common fields of all the ads types
*
* adResponseInfo should be accessible from response Object only -- ANBannerAdView, ANInterstitialAd, ANInstreamVideoAd and ANNativeAdResponse).
* It is placed into ANAdProtocol instead of ANAdProtocolFoundation to avoid adResponseInfo being accessed through ANNativeAdRequest.
*/
@property (nonatomic, readwrite, strong, nullable) ANAdResponseInfo *adResponseInfo;


@end
Expand Down
56 changes: 56 additions & 0 deletions sdk/sourcefiles/ANAdResponseInfo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/* Copyright 2019 APPNEXUS INC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#import <Foundation/Foundation.h>
#import "ANAdConstants.h"

@interface ANAdResponseInfo : NSObject
/**
An AppNexus creativeID for the current creative that is displayed
*/
@property (nonatomic, readwrite, strong, nullable) NSString *creativeId;

/**
Report the Ad Type of the returned ad object.
Not available until load is complete and successful.
*/
@property (nonatomic, readwrite) ANAdType adType;

/**
An AppNexus placement ID. A placement ID is a numeric ID that's
associated with a place where ads can be shown. In our
implementations of banner and interstitial ad views, we associate
each ad view with a placement ID.
*/
@property (nonatomic, readwrite, strong, nullable) NSString *placementId;

/**
An AppNexus member ID. A member ID is a numeric ID that's associated
with the member that this app belongs to.
*/
@property (nonatomic, readwrite, assign) NSInteger memberId;

/**
An AppNexus contentSource. A contentSource can be RTB , CSM or SSM
*/
@property (nonatomic, readwrite, strong, nullable) NSString *contentSource;

/**
An AppNexus networkName. A networkName belongs to mediation adaptor class based on UTv3 response
*/
@property (nonatomic, readwrite, strong, nullable) NSString *networkName;

@end

16 changes: 16 additions & 0 deletions sdk/sourcefiles/ANMultiAdRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ limitations under the License.
* PARAMETERS
*
* memberId: Member ID common to all encapsulated AdUnits.
* publisherID: Publisher ID common to all encapsulated AdUnits.
*
* delegate: Used to receive notification of success or failure from this instance and all encapsulated AdUnits.
*
Expand All @@ -76,12 +77,18 @@ limitations under the License.
delegate: (nullable id<ANMultiAdRequestDelegate>)delegate
adUnits: (nonnull id<ANAdProtocolFoundationCore>) firstAdUnit, ... NS_REQUIRES_NIL_TERMINATION;

- (nullable instancetype)initWithMemberId: (NSInteger)memberId
publisherId: (NSInteger)publisherId
delegate: (nullable id<ANMultiAdRequestDelegate>)delegate
adUnits: (nonnull id<ANAdProtocolFoundationCore>) firstAdUnit, ... NS_REQUIRES_NIL_TERMINATION;

/**
* Initializer for ANMultiAdRequest. This method takes all essential arguments and invokes load method. Returns a new instance upon success.
*
* PARAMETERS
*
* memberId: Member ID common to all encapsulated AdUnits.
* publisherID: Publisher ID common to all encapsulated AdUnits.
*
* delegate: Used to receive notification of success or failure from this instance and all encapsulated AdUnits.
*
Expand All @@ -91,18 +98,27 @@ limitations under the License.
delegate: (nullable id<ANMultiAdRequestDelegate>)delegate
adUnits: (nonnull id<ANAdProtocolFoundationCore>) firstAdUnit, ... NS_REQUIRES_NIL_TERMINATION;

- (nullable instancetype)initAndLoadWithMemberId: (NSInteger)memberId
publisherId: (NSInteger)publisherId
delegate: (nullable id<ANMultiAdRequestDelegate>)delegate
adUnits: (nonnull id<ANAdProtocolFoundationCore>) firstAdUnit, ... NS_REQUIRES_NIL_TERMINATION;

/**
* Initializer for ANMultiAdRequest. This method takes the minimum required arguments and returns a new instance on success.
*
* PARAMETERS
*
* memberId: Member ID common to all encapsulated AdUnits.
* publisherID: Publisher ID common to all encapsulated AdUnits.
*
* delegate: Used to receive notification of success or failure from this instance and all encapsulated AdUnits.
*/
- (nullable instancetype)initWithMemberId: (NSInteger)memberId
andDelegate: (nullable id<ANMultiAdRequestDelegate>)delegate;

- (nullable instancetype)initWithMemberId: (NSInteger)memberId
publisherId: (NSInteger)publisherId
andDelegate: (nullable id<ANMultiAdRequestDelegate>)delegate;


/**
Expand Down
4 changes: 2 additions & 2 deletions sdk/sourcefiles/Categories/ANAdView+PrivateMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
- (void)loadAdFromVast: (nonnull NSString *)xml width: (int)width
height: (int)height;

- (void)setAdResponseInfo:(nonnull ANAdResponseInfo *)adResponseInfo;
- (void)setCreativeId:(nonnull NSString *)creativeId;


Expand All @@ -55,7 +56,6 @@
@property (nonatomic, readwrite, strong, nonnull) NSString *utRequestUUIDString;


- (void)ingestAdResponseTag: (nonnull id)tag
totalLatencyStartTime: (NSTimeInterval)totalLatencyStartTime;
- (void)ingestAdResponseTag: (nonnull id)tag;

@end
3 changes: 1 addition & 2 deletions sdk/sourcefiles/Categories/NSString+ANCategory.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
- (NSString *)an_encodeAsURIComponent;
- (NSString *)an_stringByAppendingUrlParameter:(NSString *)name value:(NSString*)value;
- (NSString *)an_responseTrackerReasonCode:(int)reasonCode
latency:(NSTimeInterval)latency
totalLatency:(NSTimeInterval) totalLatency;
latency:(NSTimeInterval)latency;

@end
Loading

0 comments on commit 1efa18b

Please sign in to comment.