Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update callback ads #1

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions MobileAds/AdMob/AdResume/AdResumeManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? "",
Expand Down Expand Up @@ -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 ?? "",
Expand Down
11 changes: 6 additions & 5 deletions MobileAds/AdMob/Constants/ConstantsAds.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions MobileAds/AdMob/Manager/AdMobManager+Banner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? "",
Expand Down
1 change: 1 addition & 0 deletions MobileAds/AdMob/Manager/AdMobManager+Interstitial.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? "",
Expand Down
1 change: 1 addition & 0 deletions MobileAds/AdMob/Manager/AdMobManager+Native.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? "",
Expand Down
1 change: 1 addition & 0 deletions MobileAds/AdMob/Manager/AdMobManager+Rewarded.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? "",
Expand Down