-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
Showing
808 changed files
with
48,424 additions
and
1,687 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
||
|
||
|
101 changes: 101 additions & 0 deletions
101
...s/SimpleMediation/SimpleCSR/CSRViewController/Facebook/FacebookCSRNativeBanner.storyboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
80 changes: 80 additions & 0 deletions
80
examples/SimpleMediation/SimpleCSR/CSRViewController/Facebook/FacebookCSRNativeBanner.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
|
||
} | ||
|
34 changes: 34 additions & 0 deletions
34
examples/SimpleMediation/SimpleCSR/SupportingFile/AppDelegate.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
|
||
|
||
|
||
|
||
} | ||
|
Oops, something went wrong.