From 73a6fdbb0bf44944694db71dda1a6b06f2b30871 Mon Sep 17 00:00:00 2001 From: dkamphuoc Date: Mon, 17 Jul 2023 09:38:27 +0700 Subject: [PATCH] update callback ads --- MobileAds/AdMob/AdResume/AdResumeManager.swift | 2 ++ MobileAds/AdMob/Constants/ConstantsAds.swift | 11 ++++++----- MobileAds/AdMob/Manager/AdMobManager+Banner.swift | 1 + .../AdMob/Manager/AdMobManager+Interstitial.swift | 1 + MobileAds/AdMob/Manager/AdMobManager+Native.swift | 1 + MobileAds/AdMob/Manager/AdMobManager+Rewarded.swift | 1 + 6 files changed, 12 insertions(+), 5 deletions(-) diff --git a/MobileAds/AdMob/AdResume/AdResumeManager.swift b/MobileAds/AdMob/AdResume/AdResumeManager.swift index 5559e7f..4aebdf9 100644 --- a/MobileAds/AdMob/AdResume/AdResumeManager.swift +++ b/MobileAds/AdMob/AdResume/AdResumeManager.swift @@ -108,6 +108,7 @@ open class AdResumeManager: NSObject { ad.paidEventHandler = { [weak self] value in let responseInfo = ad.responseInfo.loadedAdNetworkResponseInfo self?.blockLoadAdsOpenSuccess?(self?.resumeAdId?.rawValue ?? "", + value, value.precision.rawValue, Int(truncating: value.value), responseInfo?.adSourceID ?? "", @@ -165,6 +166,7 @@ open class AdResumeManager: NSObject { _ad.paidEventHandler = { [weak self] value in let responseInfo = _ad.responseInfo.loadedAdNetworkResponseInfo self?.blockLoadAdsOpenSuccess?(adId.rawValue, + value, value.precision.rawValue, Int(truncating: value.value), responseInfo?.adSourceID ?? "", diff --git a/MobileAds/AdMob/Constants/ConstantsAds.swift b/MobileAds/AdMob/Constants/ConstantsAds.swift index d1eb6bb..e3370c3 100644 --- a/MobileAds/AdMob/Constants/ConstantsAds.swift +++ b/MobileAds/AdMob/Constants/ConstantsAds.swift @@ -7,16 +7,17 @@ import Foundation import UIKit +import GoogleMobileAds public typealias VoidBlockAds = () -> Void public typealias BoolBlockAds = (Bool) -> Void public typealias StringBlockAds = (String) -> Void public typealias IntBlockAds = (Int) -> Void -public typealias LogNativeLoadSuccess = (_ adUnitId: String, _ precision_type: Int, _ revenue_micros: Int, _ ad_source_id: String, _ ad_source_name: String) -> Void -public typealias LogBannerLoadSuccess = (_ adUnitId: String, _ precision_type: Int, _ revenue_micros: Int, _ ad_source_id: String, _ ad_source_name: String) -> Void -public typealias LogInterstitialAdLoadSuccess = (_ adUnitId: String, _ precision_type: Int, _ revenue_micros: Int, _ ad_source_id: String, _ ad_source_name: String) -> Void -public typealias LogRewardedAdLoadSuccess = (_ adUnitId: String, _ precision_type: Int, _ revenue_micros: Int, _ ad_source_id: String, _ ad_source_name: String) -> Void -public typealias LogAdsOpenLoadSuccess = (_ adUnitId: String, _ precision_type: Int, _ revenue_micros: Int, _ ad_source_id: String, _ ad_source_name: String) -> Void +public typealias LogNativeLoadSuccess = (_ adUnitId: String, _ value: GADAdValue, _ precision_type: Int, _ revenue_micros: Int, _ ad_source_id: String, _ ad_source_name: String) -> Void +public typealias LogBannerLoadSuccess = (_ adUnitId: String, _ value: GADAdValue, _ precision_type: Int, _ revenue_micros: Int, _ ad_source_id: String, _ ad_source_name: String) -> Void +public typealias LogInterstitialAdLoadSuccess = (_ adUnitId: String, _ value: GADAdValue, _ precision_type: Int, _ revenue_micros: Int, _ ad_source_id: String, _ ad_source_name: String) -> Void +public typealias LogRewardedAdLoadSuccess = (_ adUnitId: String, _ value: GADAdValue, _ precision_type: Int, _ revenue_micros: Int, _ ad_source_id: String, _ ad_source_name: String) -> Void +public typealias LogAdsOpenLoadSuccess = (_ adUnitId: String, _ value: GADAdValue, _ precision_type: Int, _ revenue_micros: Int, _ ad_source_id: String, _ ad_source_name: String) -> Void let screenWidthAds = UIScreen.main.bounds.width let screenHeightAds = UIScreen.main.bounds.height diff --git a/MobileAds/AdMob/Manager/AdMobManager+Banner.swift b/MobileAds/AdMob/Manager/AdMobManager+Banner.swift index ad0bd81..b4077e1 100644 --- a/MobileAds/AdMob/Manager/AdMobManager+Banner.swift +++ b/MobileAds/AdMob/Manager/AdMobManager+Banner.swift @@ -29,6 +29,7 @@ extension AdMobManager: GADBannerViewDelegate { adBannerView.paidEventHandler = {[weak self] value in let responseInfo = adBannerView.responseInfo?.loadedAdNetworkResponseInfo self?.blockLoadBannerSuccess?(unitId.rawValue, + value, value.precision.rawValue, Int(truncating: value.value), responseInfo?.adSourceID ?? "", diff --git a/MobileAds/AdMob/Manager/AdMobManager+Interstitial.swift b/MobileAds/AdMob/Manager/AdMobManager+Interstitial.swift index 62a757d..ced9ac4 100644 --- a/MobileAds/AdMob/Manager/AdMobManager+Interstitial.swift +++ b/MobileAds/AdMob/Manager/AdMobManager+Interstitial.swift @@ -45,6 +45,7 @@ extension AdMobManager: GADFullScreenContentDelegate { ad.paidEventHandler = {[weak self] value in let responseInfo = ad.responseInfo.loadedAdNetworkResponseInfo self?.blockLoadInterstitialAdSuccess?(ad.adUnitID, + value, value.precision.rawValue, Int(truncating: value.value), responseInfo?.adSourceID ?? "", diff --git a/MobileAds/AdMob/Manager/AdMobManager+Native.swift b/MobileAds/AdMob/Manager/AdMobManager+Native.swift index f6f2910..0d7425b 100644 --- a/MobileAds/AdMob/Manager/AdMobManager+Native.swift +++ b/MobileAds/AdMob/Manager/AdMobManager+Native.swift @@ -135,6 +135,7 @@ extension AdMobManager: GADNativeAdLoaderDelegate { nativeAd.paidEventHandler = {[weak self] value in let responseInfo = nativeAd.responseInfo.loadedAdNetworkResponseInfo self?.blockLogNativeLoadSuccess?(adLoader.adUnitID, + value, value.precision.rawValue, Int(truncating: value.value), responseInfo?.adSourceID ?? "", diff --git a/MobileAds/AdMob/Manager/AdMobManager+Rewarded.swift b/MobileAds/AdMob/Manager/AdMobManager+Rewarded.swift index b1104e7..3e42f14 100644 --- a/MobileAds/AdMob/Manager/AdMobManager+Rewarded.swift +++ b/MobileAds/AdMob/Manager/AdMobManager+Rewarded.swift @@ -47,6 +47,7 @@ extension AdMobManager { ad.paidEventHandler = {[weak self] value in let responseInfo = ad.responseInfo.loadedAdNetworkResponseInfo self?.blockLoadRewardedAdSuccess?(ad.adUnitID, + value, value.precision.rawValue, Int(truncating: value.value), responseInfo?.adSourceID ?? "",