Skip to content

Commit

Permalink
v4.7.5
Browse files Browse the repository at this point in the history
  • Loading branch information
github-jeremy-grosjean committed Jul 23, 2020
1 parent 39c6d7c commit 7d8fd60
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion GoogleMobileAdsMediationTeads.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = 'GoogleMobileAdsMediationTeads'
s.version = '4.7.4'
s.version = '4.7.5'
s.summary = "AdMob Adapter for Teads' iOS SDK"
s.module_name = 'TeadsAdMobAdapter'
s.description = <<-DESC
Expand Down
14 changes: 11 additions & 3 deletions TeadsAdMobAdapter/GADMAdapterTeadsBanner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,20 @@ import GoogleMobileAds
banner.load(teadsAdSettings: adSettings)
currentBanner = banner
}

private func updateRatio(_ ratio: CGFloat) {
if let width = currentBanner?.frame.width {
currentBanner?.frame = CGRect(origin: CGPoint.zero, size: CGSize(width: width, height: width / ratio))
}
}
}

// MARK: - TFAAdDelegate Protocol

extension GADMAdapterTeadsBanner: TFAAdDelegate {
public func didUpdateRatio(_ ad: TFAAdView, ratio: CGFloat) {
//will be implemented soon
}

public func didReceiveAd(_ ad: TFAAdView, adRatio: CGFloat) {
updateRatio(adRatio)
delegate?.customEventBanner(self, didReceiveAd: ad)
}

Expand Down Expand Up @@ -100,6 +104,10 @@ extension GADMAdapterTeadsBanner: TFAAdDelegate {
// TODO: What to do ?
}

public func didUpdateRatio(_ ad: TFAAdView, ratio: CGFloat) {
updateRatio(ratio)
}

// TODO: add support for these optional callbacks
//- (void)customEventBannerWillLeaveApplication:(id<GADCustomEventBanner>)customEvent;
// We should handle a new TFAAdDelegate.adWillLeaveApplication to handle app to app opening
Expand Down

0 comments on commit 7d8fd60

Please sign in to comment.