Skip to content

Commit e2001c2

Browse files
committed
feat(): update package version
1 parent fa4c1b5 commit e2001c2

10 files changed

Lines changed: 94 additions & 93 deletions

File tree

CapacitorCommunityAdmob.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ Pod::Spec.new do |s|
1515
s.swift_version = '5.1'
1616
s.static_framework = true
1717
s.dependency 'Capacitor'
18-
s.dependency 'Google-Mobile-Ads-SDK', '11.3.0'
19-
s.dependency 'GoogleUserMessagingPlatform', '>= 2.7.0', '< 3.0.0'
18+
s.dependency 'Google-Mobile-Ads-SDK', '12.7.0'
19+
s.dependency 'GoogleUserMessagingPlatform', '3.0.0'
2020
end

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ let package = Package(
1111
],
1212
dependencies: [
1313
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0"),
14-
.package(url: "https://github.com/googleads/swift-package-manager-google-mobile-ads.git", from: "11.3.0")
14+
.package(url: "https://github.com/googleads/swift-package-manager-google-mobile-ads.git", from: "12.7.0")
1515
],
1616
targets: [
1717
.target(

android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ ext {
44
androidxCoordinatorLayoutVersion = project.hasProperty('androidxCoordinatorLayoutVersion') ? rootProject.ext.androidxCoordinatorLayoutVersion : '1.2.0'
55
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
66
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
7-
playServicesAdsVersion = project.hasProperty('playServicesAdsVersion') ? rootProject.ext.playServicesAdsVersion : '23.0.0'
7+
playServicesAdsVersion = project.hasProperty('playServicesAdsVersion') ? rootProject.ext.playServicesAdsVersion : '24.4.+'
88
androidxCoreKTXVersion = project.hasProperty('androidxCoreKTXVersion') ? rootProject.ext.androidxCoreKTXVersion : '1.13.0'
99
}
1010

1111
buildscript {
12-
ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '1.9.25'
12+
ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '2.1.0'
1313
repositories {
1414
google()
1515
mavenCentral()

demo/angular/ios/App/Podfile.lock

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
PODS:
22
- Capacitor (7.0.1):
33
- CapacitorCordova
4-
- CapacitorCommunityAdmob (7.0.0):
4+
- CapacitorCommunityAdmob (7.0.3):
55
- Capacitor
6-
- Google-Mobile-Ads-SDK (= 11.3.0)
6+
- Google-Mobile-Ads-SDK (= 12.7.0)
7+
- GoogleUserMessagingPlatform (= 3.0.0)
78
- CapacitorCordova (7.0.1)
8-
- Google-Mobile-Ads-SDK (11.3.0):
9+
- Google-Mobile-Ads-SDK (12.7.0):
910
- GoogleUserMessagingPlatform (>= 1.1)
10-
- GoogleUserMessagingPlatform (2.7.0)
11+
- GoogleUserMessagingPlatform (3.0.0)
1112

1213
DEPENDENCIES:
1314
- "Capacitor (from `../../node_modules/@capacitor/ios`)"
@@ -28,12 +29,12 @@ EXTERNAL SOURCES:
2829
:path: "../../node_modules/@capacitor/ios"
2930

3031
SPEC CHECKSUMS:
31-
Capacitor: 23fff43571a4d1e3ee7d67b5a3588c6e757c2913
32-
CapacitorCommunityAdmob: 3a92f9967913e8d53aeaed8e4d1a3b5b51a6d228
32+
Capacitor: de199cba6c8b20995428ad0b7cb0bc6ca625ffd4
33+
CapacitorCommunityAdmob: a560e4f094932dd0f6cef05018e00615dfabeef6
3334
CapacitorCordova: 63d476958d5022d76f197031e8b7ea3519988c64
34-
Google-Mobile-Ads-SDK: 301a16c461c331ba34ff4dab40a22ab7c147af61
35-
GoogleUserMessagingPlatform: a8b56893477f67212fbc8411c139e61d463349f5
35+
Google-Mobile-Ads-SDK: 90a3936b11fcb1a9a69b2a33fb608e793666ce73
36+
GoogleUserMessagingPlatform: f8d0cdad3ca835406755d0a69aa634f00e76d576
3637

3738
PODFILE CHECKSUM: cc932066d42cbba5a5dcf74773455d5ab18749f7
3839

39-
COCOAPODS: 1.15.2
40+
COCOAPODS: 1.16.2

ios/Sources/AdMobPlugin/AdMobPlugin.swift

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class AdMobPlugin: CAPPlugin, CAPBridgedPlugin {
4949
self.consentExecutor.plugin = self
5050
self.setRequestConfiguration(call)
5151

52-
GADMobileAds.sharedInstance().start(completionHandler: nil)
52+
MobileAds.shared.start(completionHandler: nil)
5353
call.resolve([:])
5454
}
5555

@@ -72,7 +72,7 @@ public class AdMobPlugin: CAPPlugin, CAPBridgedPlugin {
7272

7373
@objc func setApplicationMuted(_ call: CAPPluginCall) {
7474
if let shouldMute = call.getBool("muted") {
75-
GADMobileAds.sharedInstance().applicationMuted = shouldMute
75+
MobileAds.shared.isApplicationMuted = shouldMute
7676
call.resolve([:])
7777
} else {
7878
call.reject("muted property cannot be null")
@@ -85,7 +85,7 @@ public class AdMobPlugin: CAPPlugin, CAPBridgedPlugin {
8585
// Clamp volumes.
8686
if volume < 0.0 {volume = 0.0} else if volume > 1.0 {volume = 1.0}
8787

88-
GADMobileAds.sharedInstance().applicationVolume = volume
88+
MobileAds.shared.applicationVolume = volume
8989

9090
call.resolve([:])
9191
} else {
@@ -252,11 +252,11 @@ public class AdMobPlugin: CAPPlugin, CAPBridgedPlugin {
252252
return adUnitID
253253
}
254254

255-
private func GADRequestWithOption(_ npa: Bool) -> GADRequest {
256-
let request = GADRequest()
255+
private func GADRequestWithOption(_ npa: Bool) -> Request {
256+
let request = Request()
257257

258258
if npa {
259-
let extras = GADExtras()
259+
let extras = Extras()
260260
extras.additionalParameters = ["npa": "1"]
261261
request.register(extras)
262262
}
@@ -270,30 +270,30 @@ public class AdMobPlugin: CAPPlugin, CAPBridgedPlugin {
270270
private func setRequestConfiguration(_ call: CAPPluginCall) {
271271

272272
if call.getBool("initializeForTesting") ?? false {
273-
GADMobileAds.sharedInstance().requestConfiguration.testDeviceIdentifiers = call.getArray("testingDevices", String.self) ?? []
273+
MobileAds.shared.requestConfiguration.testDeviceIdentifiers = call.getArray("testingDevices", String.self) ?? []
274274
}
275275

276276
if call.getBool("tagForChildDirectedTreatment") == true {
277-
GADMobileAds.sharedInstance().requestConfiguration.tagForChildDirectedTreatment = true
277+
MobileAds.shared.requestConfiguration.tagForChildDirectedTreatment = true
278278
}
279279

280280
if call.getBool("tagForUnderAgeOfConsent") == true {
281-
GADMobileAds.sharedInstance().requestConfiguration.tagForUnderAgeOfConsent = true
281+
MobileAds.shared.requestConfiguration.tagForUnderAgeOfConsent = true
282282
}
283283

284284
if call.getString("maxAdContentRating") != nil {
285285
switch call.getString("maxAdContentRating") {
286286
case "General":
287-
GADMobileAds.sharedInstance().requestConfiguration.maxAdContentRating =
287+
MobileAds.shared.requestConfiguration.maxAdContentRating =
288288
GADMaxAdContentRating.general
289289
case "ParentalGuidance":
290-
GADMobileAds.sharedInstance().requestConfiguration.maxAdContentRating =
290+
MobileAds.shared.requestConfiguration.maxAdContentRating =
291291
GADMaxAdContentRating.parentalGuidance
292292
case "Teen":
293-
GADMobileAds.sharedInstance().requestConfiguration.maxAdContentRating =
293+
MobileAds.shared.requestConfiguration.maxAdContentRating =
294294
GADMaxAdContentRating.teen
295295
case "MatureAudience":
296-
GADMobileAds.sharedInstance().requestConfiguration.maxAdContentRating =
296+
MobileAds.shared.requestConfiguration.maxAdContentRating =
297297
GADMaxAdContentRating.matureAudience
298298
default:
299299
print("maxAdContentRating can't find value")

ios/Sources/AdMobPlugin/Banner/BannerExecutor.swift

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,34 @@ import Foundation
22
import Capacitor
33
import GoogleMobileAds
44

5-
class BannerExecutor: NSObject, GADBannerViewDelegate {
5+
class BannerExecutor: NSObject, BannerViewDelegate {
66
weak var plugin: AdMobPlugin?
7-
var bannerView: GADBannerView!
7+
var bannerView: BannerView!
88

9-
func showBanner(_ call: CAPPluginCall, _ request: GADRequest, _ adUnitID: String) {
9+
func showBanner(_ call: CAPPluginCall, _ request: Request, _ adUnitID: String) {
1010
if let rootViewController = plugin?.getRootVC() {
1111

1212
let adSize = call.getString("adSize") ?? "ADAPTIVE_BANNER"
1313
let adPosition = call.getString("position") ?? "BOTTOM_CENTER"
1414
let adMargin = call.getInt("margin") ?? 0
1515

16-
var bannerSize: GADAdSize
16+
var bannerSize: AdSize
1717

1818
switch adSize {
1919
case "BANNER":
20-
bannerSize = GADAdSizeBanner
20+
bannerSize = AdSizeBanner
2121
break
2222
case "LARGE_BANNER":
23-
bannerSize = GADAdSizeLargeBanner
23+
bannerSize = AdSizeLargeBanner
2424
break
2525
case "FULL_BANNER":
26-
bannerSize = GADAdSizeFullBanner
26+
bannerSize = AdSizeFullBanner
2727
break
2828
case "LEADERBOARD":
29-
bannerSize = GADAdSizeLeaderboard
29+
bannerSize = AdSizeLeaderboard
3030
break
3131
case "MEDIUM_RECTANGLE":
32-
bannerSize = GADAdSizeMediumRectangle
32+
bannerSize = AdSizeMediumRectangle
3333
break
3434
case "SMART_BANNER":
3535
bannerSize = kGADAdSizeSmartBannerPortrait
@@ -45,11 +45,11 @@ class BannerExecutor: NSObject, GADBannerViewDelegate {
4545
}
4646
}()
4747
let viewWidth = frame.size.width
48-
bannerSize = GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(viewWidth)
48+
bannerSize = currentOrientationAnchoredAdaptiveBanner(width: viewWidth)
4949
break
5050
}
5151

52-
self.bannerView = GADBannerView(adSize: bannerSize)
52+
self.bannerView = BannerView(adSize: bannerSize)
5353
self.addBannerViewToView(self.bannerView, adPosition, adMargin)
5454
self.bannerView.translatesAutoresizingMaskIntoConstraints = false
5555
self.bannerView.adUnitID = adUnitID
@@ -107,7 +107,7 @@ class BannerExecutor: NSObject, GADBannerViewDelegate {
107107
call.resolve([:])
108108
}
109109

110-
private func addBannerViewToView(_ bannerView: GADBannerView, _ adPosition: String, _ Margin: Int) {
110+
private func addBannerViewToView(_ bannerView: BannerView, _ adPosition: String, _ Margin: Int) {
111111
removeBannerViewToView()
112112
if let rootViewController = plugin?.getRootVC() {
113113

@@ -144,7 +144,7 @@ class BannerExecutor: NSObject, GADBannerViewDelegate {
144144
}
145145

146146
/// Tells the delegate an ad request loaded an ad.
147-
func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
147+
func bannerViewDidReceiveAd(_ bannerView: BannerView) {
148148
NSLog("bannerViewDidReceiveAd")
149149

150150
self.plugin?.notifyListeners(BannerAdPluginEvents.SizeChanged.rawValue, data: [
@@ -155,7 +155,7 @@ class BannerExecutor: NSObject, GADBannerViewDelegate {
155155
}
156156

157157
/// Tells the delegate an ad request failed.
158-
func bannerView(_ bannerView: GADBannerView,
158+
func bannerView(_ bannerView: BannerView,
159159
didFailToReceiveAdWithError error: Error) {
160160
NSLog("bannerView:didFailToReceiveAdWithError: \(error.localizedDescription)")
161161
self.removeBannerViewToView()
@@ -169,18 +169,18 @@ class BannerExecutor: NSObject, GADBannerViewDelegate {
169169
])
170170
}
171171

172-
func bannerViewDidRecordImpression(_ bannerView: GADBannerView) {
172+
func bannerViewDidRecordImpression(_ bannerView: BannerView) {
173173
self.plugin?.notifyListeners(BannerAdPluginEvents.AdImpression.rawValue, data: [:])
174174
}
175175

176176
/// Tells the delegate that a full-screen view will be presented in response
177177
/// to the user clicking on an ad.
178-
func bannerViewWillPresentScreen(_ bannerView: GADBannerView) {
178+
func bannerViewWillPresentScreen(_ bannerView: BannerView) {
179179
self.plugin?.notifyListeners(BannerAdPluginEvents.Opened.rawValue, data: [:])
180180
}
181181

182182
/// Tells the delegate that the full-screen view will be dismissed.
183-
func bannerViewWillDismissScreen(_ bannerView: GADBannerView) {
183+
func bannerViewWillDismissScreen(_ bannerView: BannerView) {
184184
self.plugin?.notifyListeners(BannerAdPluginEvents.Closed.rawValue, data: [:])
185185
}
186186
}

ios/Sources/AdMobPlugin/Consent/ConsentExecutor.swift

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,55 +7,55 @@ class ConsentExecutor: NSObject {
77
weak var plugin: AdMobPlugin?
88

99
func requestConsentInfo(_ call: CAPPluginCall, _ debugGeography: Int, _ testDeviceIdentifiers: [String], _ tagForUnderAgeOfConsent: Bool) {
10-
let parameters = UMPRequestParameters()
11-
let debugSettings = UMPDebugSettings()
10+
let parameters = RequestParameters()
11+
let debugSettings = DebugSettings()
1212

13-
debugSettings.geography = UMPDebugGeography(rawValue: debugGeography) ?? UMPDebugGeography.disabled
13+
debugSettings.geography = DebugGeography(rawValue: debugGeography) ?? DebugGeography.disabled
1414
debugSettings.testDeviceIdentifiers = testDeviceIdentifiers
1515

1616
parameters.debugSettings = debugSettings
17-
parameters.tagForUnderAgeOfConsent = tagForUnderAgeOfConsent
17+
parameters.isTaggedForUnderAgeOfConsent = tagForUnderAgeOfConsent
1818

1919
// Request an update to the consent information.
20-
UMPConsentInformation.sharedInstance.requestConsentInfoUpdate(
20+
ConsentInformation.shared.requestConsentInfoUpdate(
2121
with: parameters,
2222
completionHandler: { error in
2323
if error != nil {
2424
call.reject("Request consent info failed")
2525
} else {
2626
call.resolve([
27-
"status": self.getConsentStatusString(UMPConsentInformation.sharedInstance.consentStatus),
28-
"isConsentFormAvailable": UMPConsentInformation.sharedInstance.formStatus == UMPFormStatus.available
27+
"status": self.getConsentStatusString(ConsentInformation.shared.consentStatus),
28+
"isConsentFormAvailable": ConsentInformation.shared.formStatus == FormStatus.available
2929
])
3030
}
3131
})
3232
}
3333

3434
func showConsentForm(_ call: CAPPluginCall) {
3535
if let rootViewController = plugin?.getRootVC() {
36-
let formStatus = UMPConsentInformation.sharedInstance.formStatus
36+
let formStatus = ConsentInformation.shared.formStatus
3737

38-
if formStatus == UMPFormStatus.available {
39-
UMPConsentForm.load(completionHandler: {form, loadError in
38+
if formStatus == FormStatus.available {
39+
ConsentForm.load(with: {form, loadError in
4040
if loadError != nil {
4141
call.reject(loadError?.localizedDescription ?? "Load consent form error")
4242
return
4343
}
4444

45-
if UMPConsentInformation.sharedInstance.consentStatus == UMPConsentStatus.required {
45+
if ConsentInformation.shared.consentStatus == ConsentStatus.required {
4646
form?.present(from: rootViewController, completionHandler: { dismissError in
4747
if dismissError != nil {
4848
call.reject(dismissError?.localizedDescription ?? "Consent dismiss error")
4949
return
5050
}
5151

5252
call.resolve([
53-
"status": self.getConsentStatusString(UMPConsentInformation.sharedInstance.consentStatus)
53+
"status": self.getConsentStatusString(ConsentInformation.shared.consentStatus)
5454
])
5555
})
5656
} else {
5757
call.resolve([
58-
"status": self.getConsentStatusString(UMPConsentInformation.sharedInstance.consentStatus)
58+
"status": self.getConsentStatusString(ConsentInformation.shared.consentStatus)
5959
])
6060
}
6161
})
@@ -68,17 +68,17 @@ class ConsentExecutor: NSObject {
6868
}
6969

7070
func resetConsentInfo(_ call: CAPPluginCall) {
71-
UMPConsentInformation.sharedInstance.reset()
71+
ConsentInformation.shared.reset()
7272
call.resolve()
7373
}
7474

75-
func getConsentStatusString(_ consentStatus: UMPConsentStatus) -> String {
75+
func getConsentStatusString(_ consentStatus: ConsentStatus) -> String {
7676
switch consentStatus {
77-
case UMPConsentStatus.required:
77+
case ConsentStatus.required:
7878
return "REQUIRED"
79-
case UMPConsentStatus.notRequired:
79+
case ConsentStatus.notRequired:
8080
return "NOT_REQUIRED"
81-
case UMPConsentStatus.obtained:
81+
case ConsentStatus.obtained:
8282
return "OBTAINED"
8383
default:
8484
return "UNKNOWN"

0 commit comments

Comments
 (0)