diff --git a/AppNexusSDK.podspec b/AppNexusSDK.podspec index 7f078974c..335b4fb63 100644 --- a/AppNexusSDK.podspec +++ b/AppNexusSDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "AppNexusSDK" - s.version = "7.22.0" + s.version = "8.0.0" s.platform = :ios, "10.0" s.summary = "AppNexus iOS Mobile Advertising SDK" diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 4bdef6d8c..b9c22c4a6 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,3 +1,15 @@ +## 8.0.0 + +### Announcements: +We have completed the removal of the APIs referenced in the 7.21.0 release. Please note there are breaking changes to some of our APIs, particularly for our init methods which is required for ad calls to be successful-[[XandrAd sharedInstance] initWithMemberID:1 preCacheRequestObjects:true completionHandler:nil];.  See our [8.0 integration guide](https://docs.xandr.com/bundle/mobile-sdk/page/ios-sdk-integration-instructions.html), as well as our [SDK initialization guide](https://docs.xandr.com/bundle/mobile-sdk/page/ios---sdk-initialization--v8-0-.html) for further details. + + +### Improvement/Bug Fixes ++ MS-5011 Updated impression counting methodology. Please see our new [impression counting methodology guide](https://docs.xandr.com/bundle/mobile-sdk/page/updated-impression-counting-mechanism---mobile-sdk-v8-0-and-above.html). ++ MS-4978 Fixed custom adapter issues in Swift. [Github Issue #71] ++ MS-5007 Removed all discontinued mediation adapters ++ MS-5013 Upgraded to OMSDK v1.3.31 + ## 7.22.0 ### Announcements: diff --git a/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/AppDelegate.m b/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/AppDelegate.m index a1f605d11..c1e5c050d 100644 --- a/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/AppDelegate.m +++ b/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/AppDelegate.m @@ -23,9 +23,9 @@ @interface AppDelegate () @implementation AppDelegate -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Override point for customization after application launch. - [[ANSDKSettings sharedInstance] optionalSDKInitialization:nil]; +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ + + [[XandrAd sharedInstance] initWithMemberID:1234 preCacheRequestObjects:YES completionHandler:nil]; return YES; } diff --git a/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/MultiAdRequest/MultiAdViewController.m b/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/MultiAdRequest/MultiAdViewController.m index b6bf3925c..acb332638 100644 --- a/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/MultiAdRequest/MultiAdViewController.m +++ b/examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/MultiAdRequest/MultiAdViewController.m @@ -49,8 +49,8 @@ - (void)viewDidLoad { // Add Ad Units [self.marAdRequest addAdUnit:[self createBannerAd:self.bannerAdView]]; //[self.marAdRequest addAdUnit:[self createInterstitialAd]]; - //[self.marAdRequest addAdUnit: [self createVideoAd]]; - //[self.marAdRequest addAdUnit:[self createNativeAd]]; + [self.marAdRequest addAdUnit: [self createVideoAd]]; + [self.marAdRequest addAdUnit:[self createNativeAd]]; // Load Ad Units [self.marAdRequest load]; diff --git a/examples/SimpleMediation/Podfile b/examples/SimpleMediation/Podfile index 0e217b8cb..e24177a11 100644 --- a/examples/SimpleMediation/Podfile +++ b/examples/SimpleMediation/Podfile @@ -1,14 +1,14 @@ # Define a global platform for your project. -platform :ios, '9.0' +platform :ios, '10.0' target 'SimpleMediation' do - pod 'Google-Mobile-Ads-SDK', '~> 8.5.0' - pod 'Smart-Display-SDK', '~> 7.10.1' + pod 'Google-Mobile-Ads-SDK', '~> 9.4.0' + pod 'Smart-Display-SDK', '~> 7.17.1' end @@ -18,7 +18,3 @@ target 'SimpleCSR' do pod 'FBAudienceNetwork', '~> 6.5.0' end - - - - diff --git a/examples/SimpleMediation/Podfile.lock b/examples/SimpleMediation/Podfile.lock new file mode 100644 index 000000000..8bc01d89f --- /dev/null +++ b/examples/SimpleMediation/Podfile.lock @@ -0,0 +1,88 @@ +PODS: + - FBAudienceNetwork (6.5.1): + - FBSDKCoreKit_Basics + - FBSDKCoreKit_Basics (12.0.2) + - Google-Mobile-Ads-SDK (9.4.0): + - GoogleAppMeasurement (< 10.0, >= 7.0) + - GoogleUserMessagingPlatform (>= 1.1) + - GoogleAppMeasurement (9.0.0): + - GoogleAppMeasurement/AdIdSupport (= 9.0.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.7) + - GoogleUtilities/MethodSwizzler (~> 7.7) + - GoogleUtilities/Network (~> 7.7) + - "GoogleUtilities/NSData+zlib (~> 7.7)" + - nanopb (~> 2.30908.0) + - GoogleAppMeasurement/AdIdSupport (9.0.0): + - GoogleAppMeasurement/WithoutAdIdSupport (= 9.0.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.7) + - GoogleUtilities/MethodSwizzler (~> 7.7) + - GoogleUtilities/Network (~> 7.7) + - "GoogleUtilities/NSData+zlib (~> 7.7)" + - nanopb (~> 2.30908.0) + - GoogleAppMeasurement/WithoutAdIdSupport (9.0.0): + - GoogleUtilities/AppDelegateSwizzler (~> 7.7) + - GoogleUtilities/MethodSwizzler (~> 7.7) + - GoogleUtilities/Network (~> 7.7) + - "GoogleUtilities/NSData+zlib (~> 7.7)" + - nanopb (~> 2.30908.0) + - GoogleUserMessagingPlatform (2.0.0) + - GoogleUtilities/AppDelegateSwizzler (7.7.0): + - GoogleUtilities/Environment + - GoogleUtilities/Logger + - GoogleUtilities/Network + - GoogleUtilities/Environment (7.7.0): + - PromisesObjC (< 3.0, >= 1.2) + - GoogleUtilities/Logger (7.7.0): + - GoogleUtilities/Environment + - GoogleUtilities/MethodSwizzler (7.7.0): + - GoogleUtilities/Logger + - GoogleUtilities/Network (7.7.0): + - GoogleUtilities/Logger + - "GoogleUtilities/NSData+zlib" + - GoogleUtilities/Reachability + - "GoogleUtilities/NSData+zlib (7.7.0)" + - GoogleUtilities/Reachability (7.7.0): + - GoogleUtilities/Logger + - nanopb (2.30908.0): + - nanopb/decode (= 2.30908.0) + - nanopb/encode (= 2.30908.0) + - nanopb/decode (2.30908.0) + - nanopb/encode (2.30908.0) + - PromisesObjC (2.1.0) + - Smart-Core-SDK (7.17.1) + - Smart-Display-SDK (7.17.1): + - Smart-Core-SDK (~> 7.17) + +DEPENDENCIES: + - FBAudienceNetwork (~> 6.5.0) + - Google-Mobile-Ads-SDK (~> 9.4.0) + - Smart-Display-SDK (~> 7.17.1) + +SPEC REPOS: + trunk: + - FBAudienceNetwork + - FBSDKCoreKit_Basics + - Google-Mobile-Ads-SDK + - GoogleAppMeasurement + - GoogleUserMessagingPlatform + - GoogleUtilities + - nanopb + - PromisesObjC + - Smart-Core-SDK + - Smart-Display-SDK + +SPEC CHECKSUMS: + FBAudienceNetwork: 9a5f277d6ed36a46354a045c46a4858b47407a72 + FBSDKCoreKit_Basics: c0701d1634c944d60dd3c6361d66dbd0e707a456 + Google-Mobile-Ads-SDK: 5a1d44987c82e441811ecaa5ae824e100ea819d7 + GoogleAppMeasurement: 2c2792d43ebdea0524adbc90cba9139721f3039b + GoogleUserMessagingPlatform: ab890ce5f6620f293a21b6bdd82e416a2c73aeca + GoogleUtilities: e0913149f6b0625b553d70dae12b49fc62914fd1 + nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96 + PromisesObjC: 99b6f43f9e1044bd87a95a60beff28c2c44ddb72 + Smart-Core-SDK: f9a7590d1019bec2e971bd5f4a85461d19130a69 + Smart-Display-SDK: 00bcac3ab2120401bf1756ad7d3ed553090a5623 + +PODFILE CHECKSUM: ffc868dd5fa47798510ed18256bc73f5cb65a1df + +COCOAPODS: 1.11.3 diff --git a/examples/SimpleMediation/SimpleCSR/CSRViewController/Facebook/FacebookCSRNativeBanner.swift b/examples/SimpleMediation/SimpleCSR/CSRViewController/Facebook/FacebookCSRNativeBanner.swift index 9ecfd3050..b39c687aa 100644 --- a/examples/SimpleMediation/SimpleCSR/CSRViewController/Facebook/FacebookCSRNativeBanner.swift +++ b/examples/SimpleMediation/SimpleCSR/CSRViewController/Facebook/FacebookCSRNativeBanner.swift @@ -14,7 +14,7 @@ */ import UIKit -import AppNexusSDK +import AppNexusNativeSDK import FBAudienceNetwork class FacebookCSRNativeBanner: UIViewController , ANNativeAdRequestDelegate , ANNativeAdDelegate { diff --git a/examples/SimpleMediation/SimpleCSR/SupportingFile/AppDelegate.swift b/examples/SimpleMediation/SimpleCSR/SupportingFile/AppDelegate.swift index e97aa51f3..75ec1bd1b 100644 --- a/examples/SimpleMediation/SimpleCSR/SupportingFile/AppDelegate.swift +++ b/examples/SimpleMediation/SimpleCSR/SupportingFile/AppDelegate.swift @@ -24,6 +24,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. + + // ideally initialize Xandr SDK inside AppDelegate before calling any other SDK methods + XandrAd.sharedInstance().initWithMemberID(1234, preCacheRequestObjects: true, completionHandler: nil) return true } diff --git a/examples/SimpleMediation/SimpleMediation.xcodeproj/project.pbxproj b/examples/SimpleMediation/SimpleMediation.xcodeproj/project.pbxproj index 4358f5dd1..69fcd3392 100644 --- a/examples/SimpleMediation/SimpleMediation.xcodeproj/project.pbxproj +++ b/examples/SimpleMediation/SimpleMediation.xcodeproj/project.pbxproj @@ -38,14 +38,11 @@ 0EE0D0C323FD7E0100D0C060 /* ANAdAdapterBannerSmartAd.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EE0D09223FD7E0100D0C060 /* ANAdAdapterBannerSmartAd.m */; }; 0EE0D0C423FD7E0100D0C060 /* ANAdAdapterSmartAdBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EE0D09323FD7E0100D0C060 /* ANAdAdapterSmartAdBase.m */; }; 0EE0D0C523FD7E0100D0C060 /* ANAdAdapterInterstitialSmartAd.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EE0D09723FD7E0100D0C060 /* ANAdAdapterInterstitialSmartAd.m */; }; - 0EE0D0C623FD7E0100D0C060 /* ANAdAdapterInterstitialDFP.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EE0D09A23FD7E0100D0C060 /* ANAdAdapterInterstitialDFP.m */; }; - 0EE0D0C723FD7E0100D0C060 /* ANAdAdapterNativeAdMob.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EE0D09C23FD7E0100D0C060 /* ANAdAdapterNativeAdMob.m */; }; - 0EE0D0C823FD7E0100D0C060 /* ANAdAdapterBannerDFP.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EE0D09D23FD7E0100D0C060 /* ANAdAdapterBannerDFP.m */; }; - 0EE0D0C923FD7E0100D0C060 /* ANAdAdapterBaseDFP.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EE0D09E23FD7E0100D0C060 /* ANAdAdapterBaseDFP.m */; }; - 0EE0D0CA23FD7E0100D0C060 /* ANAdAdapterBannerAdMob.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EE0D09F23FD7E0100D0C060 /* ANAdAdapterBannerAdMob.m */; }; - 0EE0D0CB23FD7E0100D0C060 /* ANAdAdapterInterstitialAdMob.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EE0D0A023FD7E0100D0C060 /* ANAdAdapterInterstitialAdMob.m */; }; 0EE0D0D423FD7ECE00D0C060 /* UnifiedNativeAdView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0EE0D0D323FD7ECE00D0C060 /* UnifiedNativeAdView.xib */; }; 5377DBB872736776143319CD /* libPods-SimpleMediation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DE667F379478A83D548F9F0D /* libPods-SimpleMediation.a */; }; + 883D7B5B2833C714004C2757 /* ANAdAdapterBannerAdMob.swift in Sources */ = {isa = PBXBuildFile; fileRef = 883D7B5A2833C714004C2757 /* ANAdAdapterBannerAdMob.swift */; }; + 8895CB922835618A00CF5993 /* ANAdAdapterInterstitialAdMob.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8895CB902835618A00CF5993 /* ANAdAdapterInterstitialAdMob.swift */; }; + 8895CB932835618A00CF5993 /* ANAdAdapterNativeAdMob.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8895CB912835618A00CF5993 /* ANAdAdapterNativeAdMob.swift */; }; FCC64C9425A7353F006E5A54 /* AppNexusSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E82E4F4245CCA5600EC19E1 /* AppNexusSDK.framework */; }; FCC64C9525A7353F006E5A54 /* AppNexusSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 0E82E4F4245CCA5600EC19E1 /* AppNexusSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; FCC64C9625A7354C006E5A54 /* AppNexusNativeSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E82E4F6245CCA5600EC19E1 /* AppNexusNativeSDK.framework */; }; @@ -138,21 +135,12 @@ 0EE0D09523FD7E0100D0C060 /* ANAdAdapterSmartAdBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANAdAdapterSmartAdBase.h; sourceTree = ""; }; 0EE0D09623FD7E0100D0C060 /* ANAdAdapterBannerSmartAd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANAdAdapterBannerSmartAd.h; sourceTree = ""; }; 0EE0D09723FD7E0100D0C060 /* ANAdAdapterInterstitialSmartAd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANAdAdapterInterstitialSmartAd.m; sourceTree = ""; }; - 0EE0D09923FD7E0100D0C060 /* ANAdAdapterBannerAdMob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANAdAdapterBannerAdMob.h; sourceTree = ""; }; - 0EE0D09A23FD7E0100D0C060 /* ANAdAdapterInterstitialDFP.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANAdAdapterInterstitialDFP.m; sourceTree = ""; }; - 0EE0D09B23FD7E0100D0C060 /* ANAdAdapterInterstitialAdMob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANAdAdapterInterstitialAdMob.h; sourceTree = ""; }; - 0EE0D09C23FD7E0100D0C060 /* ANAdAdapterNativeAdMob.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANAdAdapterNativeAdMob.m; sourceTree = ""; }; - 0EE0D09D23FD7E0100D0C060 /* ANAdAdapterBannerDFP.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANAdAdapterBannerDFP.m; sourceTree = ""; }; - 0EE0D09E23FD7E0100D0C060 /* ANAdAdapterBaseDFP.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANAdAdapterBaseDFP.m; sourceTree = ""; }; - 0EE0D09F23FD7E0100D0C060 /* ANAdAdapterBannerAdMob.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANAdAdapterBannerAdMob.m; sourceTree = ""; }; - 0EE0D0A023FD7E0100D0C060 /* ANAdAdapterInterstitialAdMob.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ANAdAdapterInterstitialAdMob.m; sourceTree = ""; }; - 0EE0D0A123FD7E0100D0C060 /* ANAdAdapterInterstitialDFP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANAdAdapterInterstitialDFP.h; sourceTree = ""; }; - 0EE0D0A223FD7E0100D0C060 /* ANAdAdapterNativeAdMob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANAdAdapterNativeAdMob.h; sourceTree = ""; }; - 0EE0D0A323FD7E0100D0C060 /* ANAdAdapterBaseDFP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANAdAdapterBaseDFP.h; sourceTree = ""; }; - 0EE0D0A423FD7E0100D0C060 /* ANAdAdapterBannerDFP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANAdAdapterBannerDFP.h; sourceTree = ""; }; 0EE0D0D323FD7ECE00D0C060 /* UnifiedNativeAdView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UnifiedNativeAdView.xib; sourceTree = ""; }; 2E25579F2531BE4E0FECD662 /* libPods-SimpleCSR.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SimpleCSR.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 7E9D464632CE623986E47C03 /* Pods-SimpleMediation.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SimpleMediation.release.xcconfig"; path = "Target Support Files/Pods-SimpleMediation/Pods-SimpleMediation.release.xcconfig"; sourceTree = ""; }; + 883D7B5A2833C714004C2757 /* ANAdAdapterBannerAdMob.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ANAdAdapterBannerAdMob.swift; sourceTree = ""; }; + 8895CB902835618A00CF5993 /* ANAdAdapterInterstitialAdMob.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ANAdAdapterInterstitialAdMob.swift; sourceTree = ""; }; + 8895CB912835618A00CF5993 /* ANAdAdapterNativeAdMob.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ANAdAdapterNativeAdMob.swift; sourceTree = ""; }; 92D9B61421003C0822F05D3F /* Pods-SimpleCSR.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SimpleCSR.debug.xcconfig"; path = "Target Support Files/Pods-SimpleCSR/Pods-SimpleCSR.debug.xcconfig"; sourceTree = ""; }; 941E857F252A95374E5394AF /* Pods-SimpleMediation.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SimpleMediation.debug.xcconfig"; path = "Target Support Files/Pods-SimpleMediation/Pods-SimpleMediation.debug.xcconfig"; sourceTree = ""; }; DE667F379478A83D548F9F0D /* libPods-SimpleMediation.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SimpleMediation.a"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -208,6 +196,9 @@ 0EE0D03C23FD6CB400D0C060 /* MediationViewController */, 0E5B044423BF641300DEBACE /* NavigationViewController */, 0E56613B23BF2F120088EB36 /* SupportFiles */, + 883D7B5A2833C714004C2757 /* ANAdAdapterBannerAdMob.swift */, + 8895CB902835618A00CF5993 /* ANAdAdapterInterstitialAdMob.swift */, + 8895CB912835618A00CF5993 /* ANAdAdapterNativeAdMob.swift */, ); path = SimpleMediation; sourceTree = ""; @@ -343,7 +334,6 @@ 0EE0D07123FD7E0100D0C060 /* mediatedviews */ = { isa = PBXGroup; children = ( - 0EE0D09823FD7E0100D0C060 /* GoogleAdMob */, 0EE0D09123FD7E0100D0C060 /* SmartAd */, ); name = mediatedviews; @@ -363,25 +353,6 @@ path = SmartAd; sourceTree = ""; }; - 0EE0D09823FD7E0100D0C060 /* GoogleAdMob */ = { - isa = PBXGroup; - children = ( - 0EE0D09923FD7E0100D0C060 /* ANAdAdapterBannerAdMob.h */, - 0EE0D09F23FD7E0100D0C060 /* ANAdAdapterBannerAdMob.m */, - 0EE0D0A423FD7E0100D0C060 /* ANAdAdapterBannerDFP.h */, - 0EE0D09D23FD7E0100D0C060 /* ANAdAdapterBannerDFP.m */, - 0EE0D0A323FD7E0100D0C060 /* ANAdAdapterBaseDFP.h */, - 0EE0D09E23FD7E0100D0C060 /* ANAdAdapterBaseDFP.m */, - 0EE0D09B23FD7E0100D0C060 /* ANAdAdapterInterstitialAdMob.h */, - 0EE0D0A023FD7E0100D0C060 /* ANAdAdapterInterstitialAdMob.m */, - 0EE0D0A123FD7E0100D0C060 /* ANAdAdapterInterstitialDFP.h */, - 0EE0D09A23FD7E0100D0C060 /* ANAdAdapterInterstitialDFP.m */, - 0EE0D0A223FD7E0100D0C060 /* ANAdAdapterNativeAdMob.h */, - 0EE0D09C23FD7E0100D0C060 /* ANAdAdapterNativeAdMob.m */, - ); - path = GoogleAdMob; - sourceTree = ""; - }; 0EFC4C97245CC28C008FE3C6 /* CSRViewController */ = { isa = PBXGroup; children = ( @@ -642,17 +613,14 @@ 0EE0D04A23FD723800D0C060 /* AdmobDFPBannerAdViewController.swift in Sources */, 0EE0D04C23FD728200D0C060 /* AdmobDFPInterstitialAdViewController.swift in Sources */, 0EE0D06623FD764800D0C060 /* AdMobDFPNativeViewController.swift in Sources */, - 0EE0D0CA23FD7E0100D0C060 /* ANAdAdapterBannerAdMob.m in Sources */, - 0EE0D0C823FD7E0100D0C060 /* ANAdAdapterBannerDFP.m in Sources */, + 8895CB932835618A00CF5993 /* ANAdAdapterNativeAdMob.swift in Sources */, 0EE0D0C323FD7E0100D0C060 /* ANAdAdapterBannerSmartAd.m in Sources */, - 0EE0D0C923FD7E0100D0C060 /* ANAdAdapterBaseDFP.m in Sources */, - 0EE0D0CB23FD7E0100D0C060 /* ANAdAdapterInterstitialAdMob.m in Sources */, - 0EE0D0C623FD7E0100D0C060 /* ANAdAdapterInterstitialDFP.m in Sources */, + 883D7B5B2833C714004C2757 /* ANAdAdapterBannerAdMob.swift in Sources */, 0EE0D0C523FD7E0100D0C060 /* ANAdAdapterInterstitialSmartAd.m in Sources */, - 0EE0D0C723FD7E0100D0C060 /* ANAdAdapterNativeAdMob.m in Sources */, 0EE0D0C423FD7E0100D0C060 /* ANAdAdapterSmartAdBase.m in Sources */, 0E5660EA23BE39AF0088EB36 /* AppDelegate.swift in Sources */, 0E5B044023BF618800DEBACE /* SimpleMediationAdTypeListViewController.swift in Sources */, + 8895CB922835618A00CF5993 /* ANAdAdapterInterstitialAdMob.swift in Sources */, 0EE0D05B23FD72A200D0C060 /* SmartAdBannerAdViewController.swift in Sources */, 0EE0D05C23FD72A200D0C060 /* SmartAdInterstitialAdViewController.swift in Sources */, 0EE0D04523FD6EB300D0C060 /* Toast.swift in Sources */, @@ -850,6 +818,14 @@ "\"$(SRCROOT)/SimpleMediation/SupportingFiles/mediatedsdk\"/**", "\"$(SRCROOT)/SimpleMediation/SupportingFiles/mediatedsdk/FacebookSDK\"/**", ); + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "\"${PODS_ROOT}/Headers/Public\"", + "\"${PODS_ROOT}/Headers/Public/GoogleUtilities\"", + "\"${PODS_ROOT}/Headers/Public/PromisesObjC\"", + "\"${PODS_ROOT}/Headers/Public/nanopb\"", + "\"$(SRCROOT)/SimpleMediation\"", + ); INFOPLIST_FILE = SimpleMediation/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -879,6 +855,14 @@ "\"$(SRCROOT)/SimpleMediation/SupportingFiles/mediatedsdk\"/**", "\"$(SRCROOT)/SimpleMediation/SupportingFiles/mediatedsdk/FacebookSDK\"/**", ); + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "\"${PODS_ROOT}/Headers/Public\"", + "\"${PODS_ROOT}/Headers/Public/GoogleUtilities\"", + "\"${PODS_ROOT}/Headers/Public/PromisesObjC\"", + "\"${PODS_ROOT}/Headers/Public/nanopb\"", + "\"$(SRCROOT)/SimpleMediation\"", + ); INFOPLIST_FILE = SimpleMediation/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = ( diff --git a/examples/SimpleMediation/SimpleMediation/ANAdAdapterBannerAdMob.swift b/examples/SimpleMediation/SimpleMediation/ANAdAdapterBannerAdMob.swift new file mode 100644 index 000000000..1cfb1c4e9 --- /dev/null +++ b/examples/SimpleMediation/SimpleMediation/ANAdAdapterBannerAdMob.swift @@ -0,0 +1,71 @@ +// +// CustomAdapter.swift +// SimpleMediation +// +// Created by System on 17/05/22. +// Copyright © 2022 Xandr. All rights reserved. +// + +import Foundation +import AppNexusSDK +import GoogleMobileAds + +@objc(ANAdAdapterBannerAdMob) +public class ANAdAdapterBannerAdMob : NSObject , ANCustomAdapterBanner , GADBannerViewDelegate { +// public var adDelegate: ANCustomAdapterBannerDelegate? + + + public var delegate: AnyObject? + var bannerView: GADBannerView! + + public func requestAd(with size: CGSize, rootViewController: UIViewController?, serverParameter parameterString: String?, adUnitId idString: String?, targetingParameters: ANTargetingParameters?) { + + bannerView = GADBannerView(adSize: GADAdSizeBanner) + + bannerView.adUnitID = "ca-app-pub-3940256099942544/2934735716" + bannerView.rootViewController = rootViewController + bannerView.delegate = self + + bannerView.load(GADRequest()) + + } + + + + + public func bannerViewDidReceiveAd(_ bannerView: GADBannerView) { + print("bannerViewDidReceiveAd") + self.delegate?.didLoadBannerAd(bannerView) + } + + public func bannerView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: Error) { + print("bannerView:didFailToReceiveAdWithError: \(error.localizedDescription)") + self.delegate?.didFail(toLoadAd: ANAdResponseCode.unable_TO_FILL()) + + } + + public func bannerViewDidRecordImpression(_ bannerView: GADBannerView) { + print("bannerViewDidRecordImpression") + self.delegate?.adDidLogImpression() + + } + + public func bannerViewWillPresentScreen(_ bannerView: GADBannerView) { + print("bannerViewWillPresentScreen") + self.delegate?.willCloseAd() + + } + + public func bannerViewWillDismissScreen(_ bannerView: GADBannerView) { + print("bannerViewWillDIsmissScreen") + self.delegate?.adDidLogImpression() + + } + + public func bannerViewDidDismissScreen(_ bannerView: GADBannerView) { + print("bannerViewDidDismissScreen") + self.delegate?.didCloseAd() + + } + +} diff --git a/examples/SimpleMediation/SimpleMediation/ANAdAdapterInterstitialAdMob.swift b/examples/SimpleMediation/SimpleMediation/ANAdAdapterInterstitialAdMob.swift new file mode 100644 index 000000000..b8356d505 --- /dev/null +++ b/examples/SimpleMediation/SimpleMediation/ANAdAdapterInterstitialAdMob.swift @@ -0,0 +1,82 @@ +// +// CustomAdapter.swift +// SimpleMediation +// +// Created by System on 17/05/22. +// Copyright © 2022 Xandr. All rights reserved. +// + +import Foundation +import AppNexusSDK +import GoogleMobileAds + +@objc(ANAdAdapterInterstitialAdMob) +public class ANAdAdapterInterstitialAdMob : NSObject , ANCustomAdapterInterstitial , GADFullScreenContentDelegate { + + + public var delegate: AnyObject? + private var interstitial: GADInterstitialAd? + + + public func requestAd(withParameter parameterString: String?, adUnitId idString: String?, targetingParameters: ANTargetingParameters?) { + let request = GADRequest() + GADInterstitialAd.load(withAdUnitID:"ca-app-pub-3940256099942544/4411468910", + request: request, + completionHandler: { [self] ad, error in + if let error = error { + print("Failed to load interstitial ad with error: \(error.localizedDescription)") + return + } + + interstitial = ad + + if interstitial != nil { + self.delegate?.didLoadInterstitialAd(self) + interstitial?.fullScreenContentDelegate = self; + + } else { + self.delegate?.didFail(toLoadAd: ANAdResponseCode.unable_TO_FILL()) + print("Ad wasn't ready") + } + } + ) + } + + public func present(from viewController: UIViewController?) { + // if (interstitial != nil) && try! interstitial?.canPresent(fromRootViewController: viewController!) != nil { + interstitial!.present(fromRootViewController: viewController!) + // } + } + + + /// Tells the delegate that the ad failed to present full screen content. + public func ad(_ ad: GADFullScreenPresentingAd, didFailToPresentFullScreenContentWithError error: Error) { + print("Ad did fail to present full screen content.") + self.delegate?.failedToDisplayAd() + } + + /// Tells the delegate that the ad will present full screen content. + public func adWillPresentFullScreenContent(_ ad: GADFullScreenPresentingAd) { + print("Ad will present full screen content.") + self.delegate?.willPresentAd() + } + + /// Tells the delegate that the ad dismissed full screen content. + public func adDidDismissFullScreenContent(_ ad: GADFullScreenPresentingAd) { + print("Ad did dismiss full screen content.") + self.delegate?.didCloseAd() + } + + public func adWillDismissFullScreenContent(_ ad: GADFullScreenPresentingAd) { + self.delegate?.willCloseAd() + } + public func adDidRecordClick(_ ad: GADFullScreenPresentingAd) { + self.delegate?.adWasClicked() + + } + + public func adDidRecordImpression(_ ad: GADFullScreenPresentingAd) { + self.delegate?.adDidLogImpression() + + } +} diff --git a/examples/SimpleMediation/SimpleMediation/ANAdAdapterNativeAdMob.swift b/examples/SimpleMediation/SimpleMediation/ANAdAdapterNativeAdMob.swift new file mode 100644 index 000000000..2f34dd2d3 --- /dev/null +++ b/examples/SimpleMediation/SimpleMediation/ANAdAdapterNativeAdMob.swift @@ -0,0 +1,138 @@ +// +// CustomAdapter.swift +// SimpleMediation +// +// Created by System on 17/05/22. +// Copyright © 2022 Xandr. All rights reserved. +// + +import Foundation +import AppNexusSDK +import GoogleMobileAds + +@objc(ANAdAdapterNativeAdMob) +public class ANAdAdapterNativeAdMob : NSObject , ANNativeCustomAdapter , GADNativeAdLoaderDelegate, GADNativeAdDelegate { + + + var nativeAdLoader: GADAdLoader! + var proxyViewController : ANProxyViewController! + var nativeAd: GADNativeAd? + + override init() { + super.init() +// hasExpired = true + proxyViewController = ANProxyViewController() + } + + public func requestNativeAd( + withServerParameter parameterString: String?, + adUnitId: String?, + targetingParameters: ANTargetingParameters? + ) { + nativeAdLoader = GADAdLoader( adUnitID: adUnitId!, + rootViewController: proxyViewController as? UIViewController, adTypes: [GADAdLoaderAdType.native], + options: []) + nativeAdLoader.delegate = self + nativeAdLoader.load(GADRequest()) + + } + + public var requestDelegate: ANNativeCustomAdapterRequestDelegate? +// @nonobjc public var hasExpired: Bool? + public var nativeAdDelegate: ANNativeCustomAdapterAdDelegate? + public var expired: ObjCBool? + + public func hasExpired() -> DarwinBoolean{ + return false + } + public func registerView(forImpressionTrackingAndClickHandling view: UIView, withRootViewController rvc: UIViewController, clickableViews: [Any]?) { + + print("registerView by Ab") + +// public func registerView(forImpressionTrackingAndClickHandling view: UIView, withRootViewController rvc: UIViewController, clickableViews: [Any]?) { + proxyViewController.rootViewController = rvc + proxyViewController.adView = view + if (nativeAd != nil) { + if view is GADNativeAdView { + let nativeContentAdView = view as? GADNativeAdView + nativeContentAdView?.nativeAd = nativeAd + } + + + return; + } + } + + public func adLoader(_ adLoader: GADAdLoader, didReceive nativeAd: GADNativeAd) { +// self.hasExpired = false + + + let response = ANNativeMediatedAdResponse( + customAdapter: self, + networkCode: ANNativeAdNetworkCode.adMob) + nativeAd.delegate = self + response?.title = nativeAd.headline + response?.body = nativeAd.body + response?.iconImageURL = nativeAd.icon?.imageURL + response?.iconImageURL = nativeAd.icon?.imageURL + response?.mainImageURL = (nativeAd.images?.first)?.imageURL + response?.callToAction = nativeAd.callToAction + response?.rating = ANNativeAdStarRating( + value: CGFloat(nativeAd.starRating?.floatValue ?? 0.0), + scale: Int(5.0)) + response?.customElements = [ + kANNativeElementObject: nativeAd + ] + requestDelegate?.didLoadNativeAd!(response!) + } + + public func adLoader(_ adLoader: GADAdLoader, didFailToReceiveAdWithError error: Error) { + requestDelegate?.didFail!(toLoadNativeAd: ANAdResponseCode.unable_TO_FILL()) + + } + + + + public func nativeAdDidRecordImpression(_ nativeAd: GADNativeAd) { + // The native ad was shown. + self.nativeAdDelegate?.adDidLogImpression!() + } + + public func nativeAdDidRecordClick(_ nativeAd: GADNativeAd) { + // The native ad was clicked on. + self.nativeAdDelegate?.adWasClicked!() + + } + + public func nativeAdWillPresentScreen(_ nativeAd: GADNativeAd) { + // The native ad will present a full screen view. + self.nativeAdDelegate?.didPresentAd!() + + } + + public func nativeAdWillDismissScreen(_ nativeAd: GADNativeAd) { + // The native ad will dismiss a full screen view. + self.nativeAdDelegate?.willCloseAd!() + + } + + public func nativeAdDidDismissScreen(_ nativeAd: GADNativeAd) { + // The native ad did dismiss a full screen view. + self.nativeAdDelegate?.didCloseAd!() + + } + + public func nativeAdWillLeaveApplication(_ nativeAd: GADNativeAd) { + // The native ad will cause the application to become inactive and + // open a new application. + self.nativeAdDelegate?.willLeaveApplication!() + + } + +// public func hasExpired() -> Bool { +// return true +// } + + + +} diff --git a/examples/SimpleMediation/SimpleMediation/MediationViewController/Admob/AdMobDFPNativeViewController.swift b/examples/SimpleMediation/SimpleMediation/MediationViewController/Admob/AdMobDFPNativeViewController.swift index 1a63b9338..1b03d3f59 100644 --- a/examples/SimpleMediation/SimpleMediation/MediationViewController/Admob/AdMobDFPNativeViewController.swift +++ b/examples/SimpleMediation/SimpleMediation/MediationViewController/Admob/AdMobDFPNativeViewController.swift @@ -18,7 +18,7 @@ import AppNexusSDK import GoogleMobileAds class AdMobDFPNativeViewController: UIViewController , ANNativeAdRequestDelegate , ANNativeAdDelegate { - var gadNativeAdView: GADUnifiedNativeAdView? + var gadNativeAdView: GADNativeAdView? var nativeAdRequest: ANNativeAdRequest? var nativeAdResponse: ANNativeAdResponse? @@ -27,7 +27,7 @@ class AdMobDFPNativeViewController: UIViewController , ANNativeAdRequestDelegate // Do any additional setup after loading the view. nativeAdRequest = ANNativeAdRequest() - nativeAdRequest!.placementId = "18144598" + nativeAdRequest!.placementId = "25115874" nativeAdRequest!.shouldLoadIconImage = true nativeAdRequest!.shouldLoadMainImage = true nativeAdRequest!.delegate = self @@ -49,7 +49,7 @@ class AdMobDFPNativeViewController: UIViewController , ANNativeAdRequestDelegate func createGADNativeAdView() { let adNib = UINib(nibName: "UnifiedNativeAdView", bundle: Bundle(for: type(of: self))) let array = adNib.instantiate(withOwner: self, options: nil) - gadNativeAdView = (array.first as! GADUnifiedNativeAdView) + gadNativeAdView = (array.first as! GADNativeAdView) } func populateGADUnifiedNativeViewWithResponse() { @@ -83,6 +83,16 @@ class AdMobDFPNativeViewController: UIViewController , ANNativeAdRequestDelegate Toast.show(message: "ad requestFailedWithError \(error)", controller: self) } + + func adDidLogImpression(_ ad: Any) { +// Toast.show(message: "adDidLogImpression", controller: self) + print("adDidLogImpression===?") + + + } + func adWillClose(_ ad: Any) { + print("adWillClose===?") + } } diff --git a/examples/SimpleMediation/SimpleMediation/MediationViewController/Admob/AdmobDFPBannerAdViewController.swift b/examples/SimpleMediation/SimpleMediation/MediationViewController/Admob/AdmobDFPBannerAdViewController.swift index 71545b183..ec0c9ec64 100644 --- a/examples/SimpleMediation/SimpleMediation/MediationViewController/Admob/AdmobDFPBannerAdViewController.swift +++ b/examples/SimpleMediation/SimpleMediation/MediationViewController/Admob/AdmobDFPBannerAdViewController.swift @@ -19,7 +19,7 @@ import AppNexusSDK class AdmobDFPBannerAdViewController: UIViewController , ANBannerAdViewDelegate{ var banner: ANBannerAdView? - let kPlacementId = "18144580" + let kPlacementId = "25115872" override func viewDidLoad() { super.viewDidLoad() @@ -42,6 +42,7 @@ class AdmobDFPBannerAdViewController: UIViewController , ANBannerAdViewDelegate{ let banner = ANBannerAdView(frame: rect, placementId: kPlacementId, adSize: size) banner.rootViewController = self banner.delegate = self + banner.autoRefreshInterval = 0 banner.clickThroughAction = ANClickThroughAction.openSDKBrowser // Since this example is for testing, we'll turn on PSAs and verbose logging. @@ -56,11 +57,21 @@ class AdmobDFPBannerAdViewController: UIViewController , ANBannerAdViewDelegate{ // MARK: - ANBannerAdViewDelegate func adDidReceiveAd(_ ad: Any) { - Toast.show(message: "adDidReceiveAd", controller: self) + print("adDidReceiveAd===?") +// Toast.show(message: "adDidReceiveAd", controller: self) } func ad(_ ad: Any, requestFailedWithError error: Error) { - Toast.show(message: "adFailed", controller: self) +// Toast.show(message: "adFailed", controller: self) + print("requestFailedWithError===?") + + } + func adDidLogImpression(_ ad: Any) { +// Toast.show(message: "adDidLogImpression", controller: self) + print("adDidLogImpression===?") + } + func adWillClose(_ ad: Any) { + print("adWillClose===?") } } diff --git a/examples/SimpleMediation/SimpleMediation/MediationViewController/Admob/AdmobDFPInterstitialAdViewController.swift b/examples/SimpleMediation/SimpleMediation/MediationViewController/Admob/AdmobDFPInterstitialAdViewController.swift index bd3558d76..8d470f1ff 100644 --- a/examples/SimpleMediation/SimpleMediation/MediationViewController/Admob/AdmobDFPInterstitialAdViewController.swift +++ b/examples/SimpleMediation/SimpleMediation/MediationViewController/Admob/AdmobDFPInterstitialAdViewController.swift @@ -19,7 +19,7 @@ import AppNexusSDK class AdmobDFPInterstitialAdViewController: UIViewController , ANInterstitialAdDelegate { var interstitialAd: ANInterstitialAd? - let kPlacementId = "18144585" + let kPlacementId = "25115873" override func viewDidLoad() { @@ -35,11 +35,23 @@ class AdmobDFPInterstitialAdViewController: UIViewController , ANInterstitialAdD // MARK: - ANInterstitialAdDelegate func adDidReceiveAd(_ ad: Any) { - Toast.show(message: "adDidReceiveAd", controller: self) + print("adDidReceiveAd===?") interstitialAd!.display(from: self) } + func ad(_ ad: Any, requestFailedWithError error: Error) { - Toast.show(message: "adFailed", controller: self) +// Toast.show(message: "adFailed", controller: self) + print("requestFailedWithError===?") + + } + func adDidLogImpression(_ ad: Any) { +// Toast.show(message: "adDidLogImpression", controller: self) + print("adDidLogImpression===?") + + + } + func adWillClose(_ ad: Any) { + print("adWillClose===?") } } diff --git a/examples/SimpleMediation/SimpleMediation/MediationViewController/Admob/UnifiedNativeAdView.xib b/examples/SimpleMediation/SimpleMediation/MediationViewController/Admob/UnifiedNativeAdView.xib index e917fe323..e9d0032e6 100644 --- a/examples/SimpleMediation/SimpleMediation/MediationViewController/Admob/UnifiedNativeAdView.xib +++ b/examples/SimpleMediation/SimpleMediation/MediationViewController/Admob/UnifiedNativeAdView.xib @@ -1,15 +1,15 @@ - + - + - + @@ -23,17 +23,17 @@ -