cordova-admob-tomitank 1.2.4 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-admob-tomitank",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Trustable Google AdMob Cordova Plugin",
5
5
  "main": "lib/index.js",
6
6
  "module": "esm/index.js",
package/plugin.xml CHANGED
@@ -1,5 +1,5 @@
1
1
  <?xml version='1.0' encoding='utf-8'?>
2
- <plugin id="cordova-admob-tomitank" version="1.2.4"
2
+ <plugin id="cordova-admob-tomitank" version="1.2.5"
3
3
  xmlns="http://apache.org/cordova/ns/plugins/1.0"
4
4
  xmlns:android="http://schemas.android.com/apk/res/android">
5
5
  <name>cordova-admob-tomitank</name>
@@ -150,13 +150,7 @@ class AMBBanner: AMBAdBase, BannerViewDelegate, AdSizeDelegate {
150
150
  }
151
151
 
152
152
  deinit {
153
- if bannerView != nil {
154
- bannerView.delegate = nil
155
- bannerView.adSizeDelegate = nil
156
- Self.stackView.removeArrangedSubview(placeholder)
157
- bannerView.removeFromSuperview()
158
- bannerView = nil
159
- }
153
+ cleanupBanner()
160
154
  }
161
155
 
162
156
  override func isLoaded() -> Bool {
@@ -164,6 +158,7 @@ class AMBBanner: AMBAdBase, BannerViewDelegate, AdSizeDelegate {
164
158
  }
165
159
 
166
160
  override func load(_ ctx: AMBContext) {
161
+ cleanupBanner() // Hack: restart when was loaded!
167
162
  if bannerView == nil {
168
163
  bannerView = BannerView(adSize: self.adSize)
169
164
  bannerView.delegate = self
@@ -217,6 +212,17 @@ class AMBBanner: AMBAdBase, BannerViewDelegate, AdSizeDelegate {
217
212
  ctx.resolve()
218
213
  }
219
214
 
215
+
216
+ func cleanupBanner() {
217
+ if bannerView != nil {
218
+ bannerView.delegate = nil
219
+ bannerView.adSizeDelegate = nil
220
+ Self.stackView.removeArrangedSubview(placeholder)
221
+ bannerView.removeFromSuperview()
222
+ bannerView = nil
223
+ }
224
+ }
225
+
220
226
  func bannerViewDidReceiveAd(_ bannerView: BannerView) {
221
227
  self.emit(AMBEvents.adLoad, [
222
228
  "size": [