Skip to content

Commit

Permalink
v7.11
Browse files Browse the repository at this point in the history
* commit 'a4b611a4a2c559a35f79a3a684e0c10d106aac92': (48 commits)
  v7.11
  Native ad expiry for MSAN
  Fixed UnitTestcase
  Admob SDK v8.0.0
  added logic to fix the firing of omid impression events
  removed the nil check
  fix for native
  code review comment fixes
  code review comment fixes
  Do Not Track signal for /ut/v3
  code review changes
  added comment for the UIView
  fix SDKSettings comments
  review comment fixes
  updated comments
  fixed crash on load testing
  Fixed Native 1px testcase
  added native tests
  updated logic on banner from width & height > 0
  removed unused API
  ...
  • Loading branch information
asharmaa committed Mar 25, 2021
2 parents f14ccbd + a4b611a commit 613625c
Show file tree
Hide file tree
Showing 808 changed files with 48,424 additions and 1,687 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.10"
s.version = "7.11"
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.69.0'
subspec.dependency 'Google-Mobile-Ads-SDK', '8.0.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
7 changes: 7 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 7.11
### Improvements/Bug Fixes
+ MS-4714 Added improvement for Ad Expiry events for Native Ads.
+ MS-4685 Added API to disable tracking cookies during auction.
### Mediation partner updates
+ MS-4656 Upgraded Google AdMob SDK from v7.69.0 to v8.0.0

## 7.10
### New Feature
+ MS-4659, MS-4674 Added support for User Id from external sources(Criteo, NetID, LiverRamp, The Trade Desk) (https://wiki.xandr.com/x/7IW1Bg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ - (void)viewDidLoad

int adWidth = 300;
int adHeight = 250;
NSString *adID = @"15215010";
NSString *adID = @"17058950";

int adWidth1 = 320;
int adHeight1 = 50;
NSString *inventoryCode = @"finanzen.net-app_ios_phone-home_index-banner";
NSInteger memberID = 7823;

// We want to center our ad on the screen.
CGRect screenRect = [[UIScreen mainScreen] bounds];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ @implementation InterstitialAdViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"Interstitial Ad";
self.interstitialAd = [[ANInterstitialAd alloc] initWithPlacementId:@"19212468"];
self.interstitialAd = [[ANInterstitialAd alloc] initWithPlacementId:@"17058950"];
self.interstitialAd.delegate = self;
self.interstitialAd.clickThroughAction = ANClickThroughActionReturnURL;
[self.interstitialAd loadAd];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ - (void)viewDidLoad {
// Create Banner Ad Object
- (ANBannerAdView *)createBannerAd:(UIView *) adView
{
self.bannerAd = [[ANBannerAdView alloc] initWithFrame:CGRectMake(0, 0, 300, 250) placementId:@"15215010" adSize:CGSizeMake(300, 250)];
self.bannerAd = [[ANBannerAdView alloc] initWithFrame:CGRectMake(0, 0, 300, 250) placementId:@"17058950" adSize:CGSizeMake(300, 250)];
self.bannerAd.rootViewController =self;
self.bannerAd.delegate =self;
self.bannerAd.shouldResizeAdToFitContainer = YES;
Expand All @@ -73,7 +73,7 @@ - (ANBannerAdView *)createBannerAd:(UIView *) adView
// Create Interstitial Ad Object
- (ANInterstitialAd *)createInterstitialAd
{
self.interstitialAd = [[ANInterstitialAd alloc] initWithPlacementId:@"19212468"];
self.interstitialAd = [[ANInterstitialAd alloc] initWithPlacementId:@"17058950"];
self.interstitialAd.delegate =self;
return self.interstitialAd;

Expand All @@ -83,7 +83,7 @@ - (ANInterstitialAd *)createInterstitialAd
// Create InstreamVideo Ad Object
- (ANInstreamVideoAd *)createVideoAd
{
self.videoAd = [[ANInstreamVideoAd alloc] initWithPlacementId:@"19212468"];
self.videoAd = [[ANInstreamVideoAd alloc] initWithPlacementId:@"17058950"];
self.videoAd.loadDelegate =self;
return self.videoAd;
}
Expand All @@ -92,7 +92,7 @@ - (ANInstreamVideoAd *)createVideoAd
- (ANNativeAdRequest *)createNativeAd
{
self.nativeAdRequest = [[ANNativeAdRequest alloc] init];
self.nativeAdRequest.placementId = @"19212468";
self.nativeAdRequest.placementId = @"17058950";
self.nativeAdRequest.shouldLoadIconImage = YES;
self.nativeAdRequest.shouldLoadMainImage = YES;
self.nativeAdRequest.delegate = self;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


NSString *const videoContent = @"https://acdn.adnxs.com/mobile/video_test/content/Scenario.mp4";
NSString *const placementId = @"19212468";
NSString *const placementId = @"17058950";



Expand Down Expand Up @@ -74,7 +74,6 @@ - (void)viewDidLoad {

[self setupContentPlayer];
self.videoAd = [[ANInstreamVideoAd alloc] initWithPlacementId:placementId];
// self.videoAd = [[ANInstreamVideoAd alloc] initWithMemberId:958 inventoryCode:@"trucksmash"];
[self.videoAd loadAdWithDelegate:self];
self.videoAd.clickThroughAction = ANClickThroughActionOpenSDKBrowser;

Expand Down
25 changes: 25 additions & 0 deletions examples/SimpleMediation/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# Define a global platform for your project.
platform :ios, '9.0'





target 'SimpleMediation' do
pod 'Google-Mobile-Ads-SDK', '~> 7.67.0'
pod 'FBAudienceNetwork', '~> 6.2.0'
pod 'Smart-Display-SDK', '~> 7.8.0'


end


target 'SimpleCSR' do
pod 'FBAudienceNetwork', '~> 6.2.0'

end




Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="b1R-qB-aWF">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--FacebookCSR Native Banner-->
<scene sceneID="3lL-K3-qaj">
<objects>
<viewController storyboardIdentifier="ANNativeAdPreviewViewController" automaticallyAdjustsScrollViewInsets="NO" useStoryboardIdentifierAsRestorationIdentifier="YES" id="b1R-qB-aWF" customClass="FacebookCSRNativeBanner" customModule="SimpleCSR" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="jzd-kg-mHT">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="662-Ua-8DL">
<rect key="frame" x="0.0" y="748" width="414" height="114"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="j1R-wu-T7x">
<rect key="frame" x="0.0" y="0.0" width="138" height="114"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="CZn-6y-hUW">
<rect key="frame" x="0.0" y="0.0" width="138" height="114"/>
<subviews>
<view userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="rIN-VK-NUW" customClass="FBMediaView">
<rect key="frame" x="0.0" y="-1" width="96" height="116"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="GEH-Nx-a2m" customClass="FBAdOptionsView">
<rect key="frame" x="0.0" y="0.0" width="18" height="30.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
</subviews>
</view>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="top" spacing="63" translatesAutoresizingMaskIntoConstraints="NO" id="tOg-4O-ULs">
<rect key="frame" x="138" y="0.0" width="138" height="114"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Facebook Banner Native Ad" lineBreakMode="tailTruncation" numberOfLines="6" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="200" translatesAutoresizingMaskIntoConstraints="NO" id="EbT-PL-8bi">
<rect key="frame" x="0.0" y="0.0" width="138" height="39"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Sponsored " lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6Am-WO-ZWx">
<rect key="frame" x="0.0" y="102" width="58" height="12"/>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qzY-Vg-DQu">
<rect key="frame" x="276" y="0.0" width="138" height="114"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eaP-s1-jis">
<rect key="frame" x="29" y="0.0" width="109" height="114"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES"/>
<color key="backgroundColor" systemColor="linkColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" name=".AppleSystemUIFont" family=".AppleSystemUIFont" pointSize="12"/>
<state key="normal">
<color key="titleColor" cocoaTouchSystemColor="tableCellGroupedBackgroundColor"/>
<preferredSymbolConfiguration key="preferredSymbolConfiguration" configurationType="font">
<fontDescription key="fontDescription" type="system" pointSize="15"/>
</preferredSymbolConfiguration>
</state>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="662-Ua-8DL" firstAttribute="leading" secondItem="QVV-Sj-p1h" secondAttribute="leading" id="oYR-Vt-Ncs"/>
<constraint firstItem="662-Ua-8DL" firstAttribute="trailing" secondItem="QVV-Sj-p1h" secondAttribute="trailing" id="wrF-SL-VQl"/>
<constraint firstItem="662-Ua-8DL" firstAttribute="bottom" secondItem="QVV-Sj-p1h" secondAttribute="bottom" id="yAe-0M-OVp"/>
</constraints>
<viewLayoutGuide key="safeArea" id="QVV-Sj-p1h"/>
</view>
<extendedEdge key="edgesForExtendedLayout"/>
<connections>
<outlet property="adCallToActionButton" destination="eaP-s1-jis" id="De7-fa-MTd"/>
<outlet property="adCoverMediaView" destination="rIN-VK-NUW" id="Fln-va-uN4"/>
<outlet property="adOptionsView" destination="GEH-Nx-a2m" id="Iha-4q-Nwd"/>
<outlet property="adTitleLabel" destination="EbT-PL-8bi" id="499-Ct-Pvf"/>
<outlet property="adUIView" destination="662-Ua-8DL" id="mdw-Lc-kos"/>
<outlet property="sponsoredLabel" destination="6Am-WO-ZWx" id="6MX-Ze-O3Z"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="aEb-Mp-pD5" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="613.04347826086962" y="158.70535714285714"/>
</scene>
</scenes>
</document>
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/* Copyright 2020 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 UIKit
import AppNexusSDK
import FBAudienceNetwork
class FacebookCSRNativeBanner: UIViewController , ANNativeAdRequestDelegate , ANNativeAdDelegate {

@IBOutlet var adCoverMediaView: FBMediaView!
@IBOutlet var adTitleLabel: UILabel!
@IBOutlet var adCallToActionButton: UIButton!
@IBOutlet var sponsoredLabel: UILabel!
@IBOutlet var adOptionsView: FBAdOptionsView!

@IBOutlet weak var adUIView: UIStackView!

var nativeAdRequest: ANNativeAdRequest?
var nativeAdResponse: ANNativeAdResponse?

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.

FBAdSettings.addTestDevice(FBAdSettings.testDeviceHash())

nativeAdRequest = ANNativeAdRequest()
nativeAdRequest!.placementId = "1906599"
nativeAdRequest!.shouldLoadIconImage = true
nativeAdRequest!.shouldLoadMainImage = true
nativeAdRequest!.delegate = self
nativeAdRequest!.loadAd()
}


func adRequest(_ request: ANNativeAdRequest, didReceive response: ANNativeAdResponse) {
Toast.show(message: "adDidReceiveAd", controller: self)
adUIView.isHidden = false
self.nativeAdResponse = response


Toast.show(message: "Native ad was loaded, constructing native UI...", controller: self)

// Render native ads onto UIView
adTitleLabel.text = self.nativeAdResponse?.title
sponsoredLabel.text = self.nativeAdResponse?.sponsoredBy
self.adCallToActionButton.setTitle(self.nativeAdResponse?.callToAction, for: .normal)
if self.nativeAdResponse?.customElements![kANNativeCSRObject] != nil && self.nativeAdResponse?.customElements![kANNativeCSRObject] != nil {
print("Register CSR Ad for tracking...")

if let fbNativeBanner = self.nativeAdResponse?.customElements![kANNativeCSRObject] as? ANAdAdapterCSRNativeBannerFacebook {
fbNativeBanner.registerView( forTracking: adUIView, withRootViewController: self, iconView: self.adCoverMediaView, clickableViews: [self.adUIView!])
}
// CSR registerViewForTracking (see example below)
}else{
// Non CSR registerViewForTracking
// See native ad examples here: https://wiki.xandr.com/display/sdk/Show+Native+Ads+on+iOS
Toast.show(message: "Non CSR Native ad was loaded", controller: self)

}
}


func adRequest(_ request: ANNativeAdRequest, didFailToLoadWithError error: Error, with adResponseInfo: ANAdResponseInfo?) {
Toast.show(message: "ad requestFailedWithError \(error)", controller: self)
}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* Copyright 2020 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 UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}




}

Loading

0 comments on commit 613625c

Please sign in to comment.