Skip to content

Commit

Permalink
For fixing issue 304 Wrong Height gets returned from Top BannerAdPlug…
Browse files Browse the repository at this point in the history
…inEvents.SizeChanged
  • Loading branch information
bbmouka committed Jan 19, 2024
1 parent aeb4e17 commit b78346c
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions ios/Plugin/Banner/BannerExecutor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,9 @@ class BannerExecutor: NSObject, GADBannerViewDelegate {
NSLog("AdMob: find subView for resumeBanner")
subView.isHidden = false

let width = subView.frame.width
var height = subView.frame.height
// For fixing issue 160 iOs banner overlapping content on iPhone with rounded corners
let safeAreaBottom = UIApplication.shared.keyWindow?.safeAreaInsets.bottom ?? 0
height += safeAreaBottom

self.plugin?.notifyListeners(BannerAdPluginEvents.SizeChanged.rawValue, data: [
"width": width,
"height": height
"width": subView.frame.width,
"height": subView.frame.height
])

call.resolve([:])
Expand Down Expand Up @@ -153,15 +147,9 @@ class BannerExecutor: NSObject, GADBannerViewDelegate {
public func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
NSLog("bannerViewDidReceiveAd")

let width = bannerView.frame.width
var height = bannerView.frame.height
// For fixing issue 160 iOs banner overlapping content on iPhone with rounded corners
let safeAreaBottom = UIApplication.shared.keyWindow?.safeAreaInsets.bottom ?? 0
height += safeAreaBottom

self.plugin?.notifyListeners(BannerAdPluginEvents.SizeChanged.rawValue, data: [
"width": width,
"height": height
"width": bannerView.frame.width,
"height": bannerView.frame.height
])
self.plugin?.notifyListeners(BannerAdPluginEvents.Loaded.rawValue, data: [:])
}
Expand Down

0 comments on commit b78346c

Please sign in to comment.