@capgo/capacitor-admob 8.0.14 → 8.1.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Maximum ad content rating enum used to restrict ads based on content rating.\n *\n * @since 1.0.0\n */\nexport var MaxAdContentRating;\n(function (MaxAdContentRating) {\n /** General Audiences */\n MaxAdContentRating[\"G\"] = \"G\";\n /** Mature Audiences */\n MaxAdContentRating[\"MA\"] = \"MA\";\n /** Parental Guidance */\n MaxAdContentRating[\"PG\"] = \"PG\";\n /** Teen */\n MaxAdContentRating[\"T\"] = \"T\";\n /** Unspecified rating */\n MaxAdContentRating[\"UNSPECIFIED\"] = \"\";\n})(MaxAdContentRating || (MaxAdContentRating = {}));\n/**\n * Tracking authorization status for iOS App Tracking Transparency.\n *\n * @since 1.0.0\n */\nexport var TrackingAuthorizationStatus;\n(function (TrackingAuthorizationStatus) {\n /** User has not yet received an authorization request */\n TrackingAuthorizationStatus[TrackingAuthorizationStatus[\"notDetermined\"] = 0] = \"notDetermined\";\n /** User restricted, device is unable to provide authorization */\n TrackingAuthorizationStatus[TrackingAuthorizationStatus[\"restricted\"] = 1] = \"restricted\";\n /** User denied authorization */\n TrackingAuthorizationStatus[TrackingAuthorizationStatus[\"denied\"] = 2] = \"denied\";\n /** User authorized access */\n TrackingAuthorizationStatus[TrackingAuthorizationStatus[\"authorized\"] = 3] = \"authorized\";\n})(TrackingAuthorizationStatus || (TrackingAuthorizationStatus = {}));\n//# sourceMappingURL=definitions.js.map","var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _MobileAd_created, _MobileAd_init, _BannerAd_loaded;\nimport { registerPlugin } from '@capacitor/core';\nconst AdMob = registerPlugin('AdMobPlus', {\n web: () => import('./web').then((m) => new m.AdMobPlusWeb()),\n});\nlet started = false;\nlet startPromise = null;\nconst start = AdMob.start;\nAdMob.start = async () => {\n startPromise = start();\n const result = await startPromise;\n started = true;\n return result;\n};\nclass MobileAd {\n constructor(opts) {\n _MobileAd_created.set(this, false);\n _MobileAd_init.set(this, null);\n this.opts = opts;\n this.id = MobileAd.nextId();\n MobileAd.allAds[this.id] = this;\n }\n static nextId() {\n MobileAd.idCounter += 1;\n return MobileAd.idCounter;\n }\n get adUnitId() {\n return this.opts.adUnitId;\n }\n async isLoaded() {\n await this.init();\n return AdMob.adIsLoaded({ id: this.id });\n }\n async load() {\n await this.init();\n return AdMob.adLoad(Object.assign(Object.assign({}, this.opts), { id: this.id }));\n }\n async show() {\n await this.init();\n return AdMob.adShow({ id: this.id });\n }\n async hide() {\n await this.init();\n return AdMob.adHide({ id: this.id });\n }\n async init() {\n var _a;\n if (__classPrivateFieldGet(this, _MobileAd_created, \"f\"))\n return;\n if (!started) {\n if (startPromise === null)\n start();\n await startPromise;\n }\n if (__classPrivateFieldGet(this, _MobileAd_init, \"f\") === null) {\n const cls = (_a = this.constructor.cls) !== null && _a !== void 0 ? _a : this.constructor.name;\n __classPrivateFieldSet(this, _MobileAd_init, AdMob.adCreate(Object.assign(Object.assign({}, this.opts), { id: this.id, cls })), \"f\");\n }\n await __classPrivateFieldGet(this, _MobileAd_init, \"f\");\n __classPrivateFieldSet(this, _MobileAd_created, true, \"f\");\n }\n}\n_MobileAd_created = new WeakMap(), _MobileAd_init = new WeakMap();\nMobileAd.allAds = {};\nMobileAd.idCounter = 0;\nclass BannerAd extends MobileAd {\n constructor(opts) {\n super(Object.assign({ position: 'bottom' }, opts));\n _BannerAd_loaded.set(this, false);\n }\n isLoaded() {\n return super.isLoaded();\n }\n async load() {\n await super.load();\n __classPrivateFieldSet(this, _BannerAd_loaded, true, \"f\");\n }\n async show() {\n if (!__classPrivateFieldGet(this, _BannerAd_loaded, \"f\"))\n await this.load();\n await super.show();\n }\n hide() {\n return super.hide();\n }\n}\n_BannerAd_loaded = new WeakMap();\nBannerAd.cls = 'BannerAd';\nclass InterstitialAd extends MobileAd {\n isLoaded() {\n return super.isLoaded();\n }\n async load() {\n return super.load();\n }\n async show() {\n return super.show();\n }\n}\nInterstitialAd.cls = 'InterstitialAd';\nclass RewardedAd extends MobileAd {\n isLoaded() {\n return super.isLoaded();\n }\n async load() {\n return super.load();\n }\n async show() {\n return super.show();\n }\n}\nRewardedAd.cls = 'RewardedAd';\nclass RewardedInterstitialAd extends MobileAd {\n isLoaded() {\n return super.isLoaded();\n }\n async load() {\n return super.load();\n }\n async show() {\n return super.show();\n }\n}\nRewardedInterstitialAd.cls = 'RewardedInterstitialAd';\nexport * from './definitions';\nexport { AdMob, BannerAd, InterstitialAd, RewardedAd, RewardedInterstitialAd };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class AdMobPlusWeb extends WebPlugin {\n addListener(eventName, listenerFunc) {\n return super.addListener(eventName, listenerFunc);\n }\n async start(...opts) {\n console.log('start', opts);\n }\n async configure(...opts) {\n console.log('configure', opts);\n }\n async configRequest(...opts) {\n console.log('configRequest', opts);\n }\n async adCreate(...opts) {\n console.log('adCreate', opts);\n }\n async adIsLoaded(...opts) {\n console.log('adIsLoaded', opts);\n return false;\n }\n async adLoad(...opts) {\n console.log('adLoad', opts);\n }\n async adShow(...opts) {\n console.log('adShow', opts);\n }\n async adHide(...opts) {\n console.log('adHide', opts);\n }\n async trackingAuthorizationStatus(...opts) {\n console.log('trackingAuthorizationStatus', opts);\n return { status: false };\n }\n async requestTrackingAuthorization(...opts) {\n console.log('requestTrackingAuthorization', opts);\n return { status: false };\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["MaxAdContentRating","TrackingAuthorizationStatus","this","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;AACWA;IACX,CAAC,UAAU,kBAAkB,EAAE;IAC/B;IACA,IAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG,GAAG;IACjC;IACA,IAAI,kBAAkB,CAAC,IAAI,CAAC,GAAG,IAAI;IACnC;IACA,IAAI,kBAAkB,CAAC,IAAI,CAAC,GAAG,IAAI;IACnC;IACA,IAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG,GAAG;IACjC;IACA,IAAI,kBAAkB,CAAC,aAAa,CAAC,GAAG,EAAE;IAC1C,CAAC,EAAEA,0BAAkB,KAAKA,0BAAkB,GAAG,EAAE,CAAC,CAAC;IACnD;IACA;IACA;IACA;IACA;AACWC;IACX,CAAC,UAAU,2BAA2B,EAAE;IACxC;IACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe;IACnG;IACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,YAAY;IAC7F;IACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;IACrF;IACA,IAAI,2BAA2B,CAAC,2BAA2B,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,YAAY;IAC7F,CAAC,EAAEA,mCAA2B,KAAKA,mCAA2B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C,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC;IACnC,IAAI;IACJ,IAAI,MAAM,2BAA2B,CAAC,GAAG,IAAI,EAAE;IAC/C,QAAQ,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,IAAI,CAAC;IACxD,QAAQ,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE;IAChC,IAAI;IACJ,IAAI,MAAM,4BAA4B,CAAC,GAAG,IAAI,EAAE;IAChD,QAAQ,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE,IAAI,CAAC;IACzD,QAAQ,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE;IAChC,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Maximum ad content rating enum used to restrict ads based on content rating.\n *\n * @since 1.0.0\n */\nexport var MaxAdContentRating;\n(function (MaxAdContentRating) {\n /** General Audiences */\n MaxAdContentRating[\"G\"] = \"G\";\n /** Mature Audiences */\n MaxAdContentRating[\"MA\"] = \"MA\";\n /** Parental Guidance */\n MaxAdContentRating[\"PG\"] = \"PG\";\n /** Teen */\n MaxAdContentRating[\"T\"] = \"T\";\n /** Unspecified rating */\n MaxAdContentRating[\"UNSPECIFIED\"] = \"\";\n})(MaxAdContentRating || (MaxAdContentRating = {}));\n/**\n * Tracking authorization status for iOS App Tracking Transparency.\n *\n * @since 1.0.0\n */\nexport var TrackingAuthorizationStatus;\n(function (TrackingAuthorizationStatus) {\n /** User has not yet received an authorization request */\n TrackingAuthorizationStatus[TrackingAuthorizationStatus[\"notDetermined\"] = 0] = \"notDetermined\";\n /** User restricted, device is unable to provide authorization */\n TrackingAuthorizationStatus[TrackingAuthorizationStatus[\"restricted\"] = 1] = \"restricted\";\n /** User denied authorization */\n TrackingAuthorizationStatus[TrackingAuthorizationStatus[\"denied\"] = 2] = \"denied\";\n /** User authorized access */\n TrackingAuthorizationStatus[TrackingAuthorizationStatus[\"authorized\"] = 3] = \"authorized\";\n})(TrackingAuthorizationStatus || (TrackingAuthorizationStatus = {}));\n//# sourceMappingURL=definitions.js.map","var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n};\nvar _MobileAd_created, _MobileAd_init, _BannerAd_loaded;\nimport { registerPlugin } from '@capacitor/core';\nconst AdMob = registerPlugin('AdMobPlus', {\n web: () => import('./web').then((m) => new m.AdMobPlusWeb()),\n});\nlet started = false;\nlet startPromise = null;\nconst start = AdMob.start.bind(AdMob);\nconst ensureStarted = async () => {\n if (started)\n return;\n if (startPromise === null) {\n startPromise = start()\n .then((result) => {\n started = true;\n return result;\n })\n .catch((error) => {\n startPromise = null;\n throw error;\n });\n }\n return startPromise;\n};\nAdMob.start = ensureStarted;\nconst adIsLoaded = AdMob.adIsLoaded.bind(AdMob);\nAdMob.adIsLoaded = (async (...args) => {\n const result = (await adIsLoaded(...args));\n return typeof result === 'boolean' ? result : result.value === true;\n});\nclass MobileAd {\n constructor(opts) {\n _MobileAd_created.set(this, false);\n _MobileAd_init.set(this, null);\n this.opts = opts;\n this.id = MobileAd.nextId();\n MobileAd.allAds[this.id] = this;\n }\n static nextId() {\n MobileAd.idCounter += 1;\n return MobileAd.idCounter;\n }\n get adUnitId() {\n return this.opts.adUnitId;\n }\n async isLoaded() {\n await this.init();\n return AdMob.adIsLoaded({ id: this.id });\n }\n async load() {\n await this.init();\n return AdMob.adLoad(Object.assign(Object.assign({}, this.opts), { id: this.id }));\n }\n async show() {\n await this.init();\n return AdMob.adShow({ id: this.id });\n }\n async hide() {\n await this.init();\n return AdMob.adHide({ id: this.id });\n }\n async init() {\n var _a;\n if (__classPrivateFieldGet(this, _MobileAd_created, \"f\"))\n return;\n if (!started) {\n await ensureStarted();\n }\n if (__classPrivateFieldGet(this, _MobileAd_init, \"f\") === null) {\n const cls = (_a = this.constructor.cls) !== null && _a !== void 0 ? _a : this.constructor.name;\n __classPrivateFieldSet(this, _MobileAd_init, AdMob.adCreate(Object.assign(Object.assign({}, this.opts), { id: this.id, cls })), \"f\");\n }\n await __classPrivateFieldGet(this, _MobileAd_init, \"f\");\n __classPrivateFieldSet(this, _MobileAd_created, true, \"f\");\n }\n}\n_MobileAd_created = new WeakMap(), _MobileAd_init = new WeakMap();\nMobileAd.allAds = {};\nMobileAd.idCounter = 0;\nclass BannerAd extends MobileAd {\n constructor(opts) {\n super(Object.assign({ position: 'bottom' }, opts));\n _BannerAd_loaded.set(this, false);\n }\n isLoaded() {\n return super.isLoaded();\n }\n async load() {\n await super.load();\n __classPrivateFieldSet(this, _BannerAd_loaded, true, \"f\");\n }\n async show() {\n if (!__classPrivateFieldGet(this, _BannerAd_loaded, \"f\"))\n await this.load();\n await super.show();\n }\n hide() {\n return super.hide();\n }\n}\n_BannerAd_loaded = new WeakMap();\nBannerAd.cls = 'BannerAd';\nclass InterstitialAd extends MobileAd {\n isLoaded() {\n return super.isLoaded();\n }\n async load() {\n return super.load();\n }\n async show() {\n return super.show();\n }\n}\nInterstitialAd.cls = 'InterstitialAd';\nclass RewardedAd extends MobileAd {\n isLoaded() {\n return super.isLoaded();\n }\n async load() {\n return super.load();\n }\n async show() {\n return super.show();\n }\n}\nRewardedAd.cls = 'RewardedAd';\nclass RewardedInterstitialAd extends MobileAd {\n isLoaded() {\n return super.isLoaded();\n }\n async load() {\n return super.load();\n }\n async show() {\n return super.show();\n }\n}\nRewardedInterstitialAd.cls = 'RewardedInterstitialAd';\nexport * from './definitions';\nexport { AdMob, BannerAd, InterstitialAd, RewardedAd, RewardedInterstitialAd };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class AdMobPlusWeb extends WebPlugin {\n addListener(eventName, listenerFunc) {\n return super.addListener(eventName, listenerFunc);\n }\n async start(...opts) {\n console.log('start', opts);\n }\n async configure(...opts) {\n console.log('configure', opts);\n }\n async configRequest(...opts) {\n console.log('configRequest', opts);\n }\n async adCreate(...opts) {\n console.log('adCreate', opts);\n }\n async adIsLoaded(...opts) {\n console.log('adIsLoaded', opts);\n return false;\n }\n async adLoad(...opts) {\n console.log('adLoad', opts);\n }\n async adShow(...opts) {\n console.log('adShow', opts);\n }\n async adHide(...opts) {\n console.log('adHide', opts);\n }\n async trackingAuthorizationStatus(...opts) {\n console.log('trackingAuthorizationStatus', opts);\n return { status: false };\n }\n async requestTrackingAuthorization(...opts) {\n console.log('requestTrackingAuthorization', opts);\n return { status: false };\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["MaxAdContentRating","TrackingAuthorizationStatus","this","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;AACWA;IACX,CAAC,UAAU,kBAAkB,EAAE;IAC/B;IACA,IAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG,GAAG;IACjC;IACA,IAAI,kBAAkB,CAAC,IAAI,CAAC,GAAG,IAAI;IACnC;IACA,IAAI,kBAAkB,CAAC,IAAI,CAAC,GAAG,IAAI;IACnC;IACA,IAAI,kBAAkB,C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J,IAAI,MAAM,2BAA2B,CAAC,GAAG,IAAI,EAAE;IAC/C,QAAQ,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,IAAI,CAAC;IACxD,QAAQ,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE;IAChC,IAAI;IACJ,IAAI,MAAM,4BAA4B,CAAC,GAAG,IAAI,EAAE;IAChD,QAAQ,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE,IAAI,CAAC;IACzD,QAAQ,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE;IAChC,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ;;;;;;;;;;;;;;;;;;;"}
@@ -5,7 +5,7 @@ import AppTrackingTransparency
5
5
 
6
6
  @objc(AdmobPlusPlugin)
7
7
  public class AdmobPlusPlugin: CAPPlugin, CAPBridgedPlugin {
8
- private let pluginVersion: String = "8.0.14"
8
+ private let pluginVersion: String = "8.1.1"
9
9
  public let identifier = "AdmobPlusPlugin"
10
10
  public let jsName = "AdMobPlus"
11
11
  public let pluginMethods: [CAPPluginMethod] = [
@@ -27,7 +27,7 @@ public class AdmobPlusPlugin: CAPPlugin, CAPBridgedPlugin {
27
27
 
28
28
  @objc func start(_ call: CAPPluginCall) {
29
29
  DispatchQueue.main.async {
30
- GADMobileAds.sharedInstance().start { _ in
30
+ MobileAds.shared.start { _ in
31
31
  call.resolve()
32
32
  }
33
33
  }
@@ -38,18 +38,18 @@ public class AdmobPlusPlugin: CAPPlugin, CAPBridgedPlugin {
38
38
  let appVolume = call.getFloat("appVolume")
39
39
 
40
40
  if let muted = appMuted {
41
- GADMobileAds.sharedInstance().applicationMuted = muted
41
+ MobileAds.shared.isApplicationMuted = muted
42
42
  }
43
43
 
44
44
  if let volume = appVolume {
45
- GADMobileAds.sharedInstance().applicationVolume = volume
45
+ MobileAds.shared.applicationVolume = volume
46
46
  }
47
47
 
48
48
  call.resolve()
49
49
  }
50
50
 
51
51
  @objc func configRequest(_ call: CAPPluginCall) {
52
- let requestConfiguration = GADMobileAds.sharedInstance().requestConfiguration
52
+ let requestConfiguration = MobileAds.shared.requestConfiguration
53
53
 
54
54
  if let maxAdContentRating = call.getString("maxAdContentRating") {
55
55
  switch maxAdContentRating {
@@ -6,7 +6,7 @@ import Capacitor
6
6
  class BannerAd: NSObject, Ad {
7
7
  let id: Int
8
8
  let adUnitId: String
9
- private var bannerView: GADBannerView?
9
+ private var bannerView: BannerView?
10
10
  private weak var plugin: AdmobPlusPlugin?
11
11
  private let position: String
12
12
  private var bannerContainer: UIView?
@@ -28,7 +28,7 @@ class BannerAd: NSObject, Ad {
28
28
  guard let self = self else { return }
29
29
 
30
30
  if self.bannerView == nil {
31
- let banner = GADBannerView(adSize: GADAdSizeBanner)
31
+ let banner = BannerView(adSize: AdSizeBanner)
32
32
  banner.adUnitID = self.adUnitId
33
33
  banner.delegate = self
34
34
  banner.rootViewController = self.plugin?.bridge?.viewController
@@ -113,31 +113,31 @@ class BannerAd: NSObject, Ad {
113
113
  }
114
114
  }
115
115
 
116
- extension BannerAd: GADBannerViewDelegate {
117
- func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
116
+ extension BannerAd: BannerViewDelegate {
117
+ func bannerViewDidReceiveAd(_ bannerView: BannerView) {
118
118
  plugin?.notifyListeners(Events.bannerLoad, data: ["id": id])
119
119
  }
120
120
 
121
- func bannerView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: Error) {
121
+ func bannerView(_ bannerView: BannerView, didFailToReceiveAdWithError error: Error) {
122
122
  plugin?.notifyListeners(Events.bannerLoadFail, data: [
123
123
  "id": id,
124
124
  "error": error.localizedDescription
125
125
  ])
126
126
  }
127
127
 
128
- func bannerViewDidRecordImpression(_ bannerView: GADBannerView) {
128
+ func bannerViewDidRecordImpression(_ bannerView: BannerView) {
129
129
  plugin?.notifyListeners(Events.bannerImpression, data: ["id": id])
130
130
  }
131
131
 
132
- func bannerViewWillPresentScreen(_ bannerView: GADBannerView) {
132
+ func bannerViewWillPresentScreen(_ bannerView: BannerView) {
133
133
  plugin?.notifyListeners(Events.bannerOpen, data: ["id": id])
134
134
  }
135
135
 
136
- func bannerViewWillDismissScreen(_ bannerView: GADBannerView) {
136
+ func bannerViewWillDismissScreen(_ bannerView: BannerView) {
137
137
  plugin?.notifyListeners(Events.bannerClose, data: ["id": id])
138
138
  }
139
139
 
140
- func bannerViewDidRecordClick(_ bannerView: GADBannerView) {
140
+ func bannerViewDidRecordClick(_ bannerView: BannerView) {
141
141
  plugin?.notifyListeners(Events.bannerClick, data: ["id": id])
142
142
  }
143
143
  }
@@ -39,17 +39,17 @@ extension Ad {
39
39
  }
40
40
 
41
41
  class AdMobHelper {
42
- static func buildAdRequest() -> GADRequest {
43
- let request = GADRequest()
42
+ static func buildAdRequest() -> Request {
43
+ let request = Request()
44
44
  return request
45
45
  }
46
46
 
47
- static func buildServerSideVerificationOptions(from object: JSObject?) -> GADServerSideVerificationOptions? {
47
+ static func buildServerSideVerificationOptions(from object: JSObject?) -> ServerSideVerificationOptions? {
48
48
  guard let object = object else {
49
49
  return nil
50
50
  }
51
51
 
52
- let options = GADServerSideVerificationOptions()
52
+ let options = ServerSideVerificationOptions()
53
53
  let userId = object["userId"] as? String
54
54
  let customData = object["customData"] as? String
55
55
 
@@ -58,7 +58,7 @@ class AdMobHelper {
58
58
  }
59
59
 
60
60
  options.userIdentifier = userId
61
- options.customRewardString = customData
61
+ options.customRewardText = customData
62
62
 
63
63
  return options
64
64
  }
@@ -6,7 +6,7 @@ import Capacitor
6
6
  class InterstitialAd: NSObject, Ad {
7
7
  let id: Int
8
8
  let adUnitId: String
9
- private var interstitial: GADInterstitialAd?
9
+ private var interstitial: GoogleMobileAds.InterstitialAd?
10
10
  private weak var plugin: AdmobPlusPlugin?
11
11
 
12
12
  var isLoaded: Bool {
@@ -23,7 +23,7 @@ class InterstitialAd: NSObject, Ad {
23
23
  func load(completion: @escaping (Error?) -> Void) {
24
24
  let request = AdMobHelper.buildAdRequest()
25
25
 
26
- GADInterstitialAd.load(withAdUnitID: adUnitId, request: request) { [weak self] ad, error in
26
+ GoogleMobileAds.InterstitialAd.load(with: adUnitId, request: request) { [weak self] ad, error in
27
27
  guard let self = self else { return }
28
28
 
29
29
  if let error = error {
@@ -55,7 +55,7 @@ class InterstitialAd: NSObject, Ad {
55
55
  return
56
56
  }
57
57
 
58
- interstitial.present(fromRootViewController: viewController)
58
+ interstitial.present(from: viewController)
59
59
  completion(nil)
60
60
  }
61
61
  }
@@ -65,27 +65,27 @@ class InterstitialAd: NSObject, Ad {
65
65
  }
66
66
  }
67
67
 
68
- extension InterstitialAd: GADFullScreenContentDelegate {
69
- func adDidRecordImpression(_ ad: GADFullScreenPresentingAd) {
68
+ extension InterstitialAd: FullScreenContentDelegate {
69
+ func adDidRecordImpression(_ ad: FullScreenPresentingAd) {
70
70
  plugin?.notifyListeners(Events.interstitialImpression, data: ["id": id])
71
71
  }
72
72
 
73
- func adDidRecordClick(_ ad: GADFullScreenPresentingAd) {
73
+ func adDidRecordClick(_ ad: FullScreenPresentingAd) {
74
74
  plugin?.notifyListeners(Events.adClick, data: ["id": id])
75
75
  }
76
76
 
77
- func ad(_ ad: GADFullScreenPresentingAd, didFailToPresentFullScreenContentWithError error: Error) {
77
+ func ad(_ ad: FullScreenPresentingAd, didFailToPresentFullScreenContentWithError error: Error) {
78
78
  plugin?.notifyListeners(Events.interstitialShowFail, data: [
79
79
  "id": id,
80
80
  "error": error.localizedDescription
81
81
  ])
82
82
  }
83
83
 
84
- func adWillPresentFullScreenContent(_ ad: GADFullScreenPresentingAd) {
84
+ func adWillPresentFullScreenContent(_ ad: FullScreenPresentingAd) {
85
85
  plugin?.notifyListeners(Events.interstitialShow, data: ["id": id])
86
86
  }
87
87
 
88
- func adDidDismissFullScreenContent(_ ad: GADFullScreenPresentingAd) {
88
+ func adDidDismissFullScreenContent(_ ad: FullScreenPresentingAd) {
89
89
  plugin?.notifyListeners(Events.interstitialDismiss, data: ["id": id])
90
90
  interstitial = nil
91
91
  }
@@ -6,15 +6,15 @@ import Capacitor
6
6
  class RewardedAd: NSObject, Ad {
7
7
  let id: Int
8
8
  let adUnitId: String
9
- private let serverSideVerificationOptions: GADServerSideVerificationOptions?
10
- private var rewardedAd: GADRewardedAd?
9
+ private let serverSideVerificationOptions: ServerSideVerificationOptions?
10
+ private var rewardedAd: GoogleMobileAds.RewardedAd?
11
11
  private weak var plugin: AdmobPlusPlugin?
12
12
 
13
13
  var isLoaded: Bool {
14
14
  return rewardedAd != nil
15
15
  }
16
16
 
17
- init(id: Int, adUnitId: String, serverSideVerificationOptions: GADServerSideVerificationOptions?, plugin: AdmobPlusPlugin) {
17
+ init(id: Int, adUnitId: String, serverSideVerificationOptions: ServerSideVerificationOptions?, plugin: AdmobPlusPlugin) {
18
18
  self.id = id
19
19
  self.adUnitId = adUnitId
20
20
  self.serverSideVerificationOptions = serverSideVerificationOptions
@@ -25,7 +25,7 @@ class RewardedAd: NSObject, Ad {
25
25
  func load(completion: @escaping (Error?) -> Void) {
26
26
  let request = AdMobHelper.buildAdRequest()
27
27
 
28
- GADRewardedAd.load(withAdUnitID: adUnitId, request: request) { [weak self] ad, error in
28
+ GoogleMobileAds.RewardedAd.load(with: adUnitId, request: request) { [weak self] ad, error in
29
29
  guard let self = self else { return }
30
30
 
31
31
  if let error = error {
@@ -58,7 +58,7 @@ class RewardedAd: NSObject, Ad {
58
58
  return
59
59
  }
60
60
 
61
- rewardedAd.present(fromRootViewController: viewController) { [weak self] in
61
+ rewardedAd.present(from: viewController) { [weak self] in
62
62
  guard let self = self else { return }
63
63
  let reward = rewardedAd.adReward
64
64
  self.plugin?.notifyListeners(Events.rewardedReward, data: [
@@ -78,27 +78,27 @@ class RewardedAd: NSObject, Ad {
78
78
  }
79
79
  }
80
80
 
81
- extension RewardedAd: GADFullScreenContentDelegate {
82
- func adDidRecordImpression(_ ad: GADFullScreenPresentingAd) {
81
+ extension RewardedAd: FullScreenContentDelegate {
82
+ func adDidRecordImpression(_ ad: FullScreenPresentingAd) {
83
83
  plugin?.notifyListeners(Events.rewardedImpression, data: ["id": id])
84
84
  }
85
85
 
86
- func adDidRecordClick(_ ad: GADFullScreenPresentingAd) {
86
+ func adDidRecordClick(_ ad: FullScreenPresentingAd) {
87
87
  plugin?.notifyListeners(Events.adClick, data: ["id": id])
88
88
  }
89
89
 
90
- func ad(_ ad: GADFullScreenPresentingAd, didFailToPresentFullScreenContentWithError error: Error) {
90
+ func ad(_ ad: FullScreenPresentingAd, didFailToPresentFullScreenContentWithError error: Error) {
91
91
  plugin?.notifyListeners(Events.rewardedShowFail, data: [
92
92
  "id": id,
93
93
  "error": error.localizedDescription
94
94
  ])
95
95
  }
96
96
 
97
- func adWillPresentFullScreenContent(_ ad: GADFullScreenPresentingAd) {
97
+ func adWillPresentFullScreenContent(_ ad: FullScreenPresentingAd) {
98
98
  plugin?.notifyListeners(Events.rewardedShow, data: ["id": id])
99
99
  }
100
100
 
101
- func adDidDismissFullScreenContent(_ ad: GADFullScreenPresentingAd) {
101
+ func adDidDismissFullScreenContent(_ ad: FullScreenPresentingAd) {
102
102
  plugin?.notifyListeners(Events.rewardedDismiss, data: ["id": id])
103
103
  rewardedAd = nil
104
104
  }
@@ -6,15 +6,15 @@ import Capacitor
6
6
  class RewardedInterstitialAd: NSObject, Ad {
7
7
  let id: Int
8
8
  let adUnitId: String
9
- private let serverSideVerificationOptions: GADServerSideVerificationOptions?
10
- private var rewardedInterstitialAd: GADRewardedInterstitialAd?
9
+ private let serverSideVerificationOptions: ServerSideVerificationOptions?
10
+ private var rewardedInterstitialAd: GoogleMobileAds.RewardedInterstitialAd?
11
11
  private weak var plugin: AdmobPlusPlugin?
12
12
 
13
13
  var isLoaded: Bool {
14
14
  return rewardedInterstitialAd != nil
15
15
  }
16
16
 
17
- init(id: Int, adUnitId: String, serverSideVerificationOptions: GADServerSideVerificationOptions?, plugin: AdmobPlusPlugin) {
17
+ init(id: Int, adUnitId: String, serverSideVerificationOptions: ServerSideVerificationOptions?, plugin: AdmobPlusPlugin) {
18
18
  self.id = id
19
19
  self.adUnitId = adUnitId
20
20
  self.serverSideVerificationOptions = serverSideVerificationOptions
@@ -25,7 +25,7 @@ class RewardedInterstitialAd: NSObject, Ad {
25
25
  func load(completion: @escaping (Error?) -> Void) {
26
26
  let request = AdMobHelper.buildAdRequest()
27
27
 
28
- GADRewardedInterstitialAd.load(withAdUnitID: adUnitId, request: request) { [weak self] ad, error in
28
+ GoogleMobileAds.RewardedInterstitialAd.load(with: adUnitId, request: request) { [weak self] ad, error in
29
29
  guard let self = self else { return }
30
30
 
31
31
  if let error = error {
@@ -58,7 +58,7 @@ class RewardedInterstitialAd: NSObject, Ad {
58
58
  return
59
59
  }
60
60
 
61
- rewardedInterstitialAd.present(fromRootViewController: viewController) { [weak self] in
61
+ rewardedInterstitialAd.present(from: viewController) { [weak self] in
62
62
  guard let self = self else { return }
63
63
  let reward = rewardedInterstitialAd.adReward
64
64
  self.plugin?.notifyListeners(Events.rewardedInterstitialReward, data: [
@@ -78,27 +78,27 @@ class RewardedInterstitialAd: NSObject, Ad {
78
78
  }
79
79
  }
80
80
 
81
- extension RewardedInterstitialAd: GADFullScreenContentDelegate {
82
- func adDidRecordImpression(_ ad: GADFullScreenPresentingAd) {
81
+ extension RewardedInterstitialAd: FullScreenContentDelegate {
82
+ func adDidRecordImpression(_ ad: FullScreenPresentingAd) {
83
83
  plugin?.notifyListeners(Events.rewardedInterstitialImpression, data: ["id": id])
84
84
  }
85
85
 
86
- func adDidRecordClick(_ ad: GADFullScreenPresentingAd) {
86
+ func adDidRecordClick(_ ad: FullScreenPresentingAd) {
87
87
  plugin?.notifyListeners(Events.adClick, data: ["id": id])
88
88
  }
89
89
 
90
- func ad(_ ad: GADFullScreenPresentingAd, didFailToPresentFullScreenContentWithError error: Error) {
90
+ func ad(_ ad: FullScreenPresentingAd, didFailToPresentFullScreenContentWithError error: Error) {
91
91
  plugin?.notifyListeners(Events.rewardedInterstitialShowFail, data: [
92
92
  "id": id,
93
93
  "error": error.localizedDescription
94
94
  ])
95
95
  }
96
96
 
97
- func adWillPresentFullScreenContent(_ ad: GADFullScreenPresentingAd) {
97
+ func adWillPresentFullScreenContent(_ ad: FullScreenPresentingAd) {
98
98
  plugin?.notifyListeners(Events.rewardedInterstitialShow, data: ["id": id])
99
99
  }
100
100
 
101
- func adDidDismissFullScreenContent(_ ad: GADFullScreenPresentingAd) {
101
+ func adDidDismissFullScreenContent(_ ad: FullScreenPresentingAd) {
102
102
  plugin?.notifyListeners(Events.rewardedInterstitialDismiss, data: ["id": id])
103
103
  rewardedInterstitialAd = nil
104
104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-admob",
3
- "version": "8.0.14",
3
+ "version": "8.1.1",
4
4
  "description": "Capacitor plugin to bridge AdMob SDKs for iOS and Android",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -33,20 +33,20 @@
33
33
  "ads"
34
34
  ],
35
35
  "scripts": {
36
- "verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
36
+ "verify": "bun run verify:ios && bun run verify:android && bun run verify:web",
37
37
  "verify:ios": "xcodebuild -scheme CapgoCapacitorAdmob -destination generic/platform=iOS",
38
38
  "verify:android": "cd android && ./gradlew clean build test && cd ..",
39
- "verify:web": "npm run build",
40
- "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
41
- "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
39
+ "verify:web": "bun run build",
40
+ "lint": "bun run eslint && bun run prettier -- --check && bun run swiftlint -- lint",
41
+ "fmt": "bun run eslint -- --fix && bun run prettier -- --write && bun run swiftlint -- --fix --format",
42
42
  "eslint": "eslint . --ext ts",
43
43
  "prettier": "prettier-pretty-check \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
44
44
  "swiftlint": "node-swiftlint",
45
45
  "docgen": "docgen --api AdMobPlusPlugin --output-readme README.md --output-json dist/docs.json",
46
- "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
46
+ "build": "bun run clean && bun run docgen && tsc && rollup -c rollup.config.mjs",
47
47
  "clean": "rimraf ./dist",
48
48
  "watch": "tsc --watch",
49
- "prepublishOnly": "npm run build",
49
+ "prepublishOnly": "bun run build",
50
50
  "check:wiring": "node scripts/check-capacitor-plugin-wiring.mjs"
51
51
  },
52
52
  "devDependencies": {