@capacitor-community/admob 8.2.1 → 8.3.0-beta.pr495.shaaa5aedc59a51
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/README.md +1 -1
- package/android/build.gradle +5 -1
- package/android/src/main/java/com/getcapacitor/community/admob/AdMob.java +15 -0
- package/android/src/main/java/com/getcapacitor/community/admob/nativeads/NativeAdExecutor.kt +257 -9
- package/dist/esm/native-ads/native-ad-definitions.interface.d.ts +6 -0
- package/dist/esm/native-ads/native-ad-feed.d.ts +3 -3
- package/dist/esm/native-ads/native-ad-feed.js +107 -32
- package/dist/esm/native-ads/native-ad-feed.js.map +1 -1
- package/dist/esm/native-ads/native-ad-geometry.js +2 -1
- package/dist/esm/native-ads/native-ad-geometry.js.map +1 -1
- package/dist/esm/native-ads/native-ad-options.interface.d.ts +6 -2
- package/dist/esm/native-ads/native-ad-placement.interface.d.ts +2 -0
- package/dist/plugin.cjs.js +165 -33
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +165 -33
- package/dist/plugin.js.map +1 -1
- package/docs/native-ads.md +32 -6
- package/ios/Sources/AdMobPlugin/AppOpen/AppOpenAdPluginEvents.swift +3 -0
- package/ios/Sources/AdMobPlugin/Banner/BannerAdPluginEvents.swift +3 -0
- package/ios/Sources/AdMobPlugin/Banner/BannerAdSizeEnum.swift +3 -0
- package/ios/Sources/AdMobPlugin/Banner/BannerExecutor.swift +4 -4
- package/ios/Sources/AdMobPlugin/Helper/AuthorizationStatusEnum.swift +3 -0
- package/ios/Sources/AdMobPlugin/Interstitial/InterstitialAdPluginEvents.swift +3 -0
- package/ios/Sources/AdMobPlugin/Rewarded/RewardAdPluginEvents.swift +3 -0
- package/ios/Sources/AdMobPlugin/RewardedInterstitial/RewardInterstitialAdPluginEvents.swift +3 -0
- package/package.json +5 -4
|
@@ -6,7 +6,7 @@ class BannerExecutor: NSObject, BannerViewDelegate {
|
|
|
6
6
|
weak var plugin: AdMobPlugin?
|
|
7
7
|
var bannerView: BannerView!
|
|
8
8
|
var adPosition: String = ""
|
|
9
|
-
var
|
|
9
|
+
var margin: Int = 0
|
|
10
10
|
|
|
11
11
|
func showBanner(_ call: CAPPluginCall, _ request: Request, _ adUnitID: String) {
|
|
12
12
|
if let rootViewController = plugin?.getRootVC() {
|
|
@@ -112,11 +112,11 @@ class BannerExecutor: NSObject, BannerViewDelegate {
|
|
|
112
112
|
call.resolve([:])
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
private func addBannerViewToView(_ bannerView: BannerView, _ adPosition: String, _
|
|
115
|
+
private func addBannerViewToView(_ bannerView: BannerView, _ adPosition: String, _ margin: Int) {
|
|
116
116
|
removeBannerViewToView()
|
|
117
117
|
bannerView.translatesAutoresizingMaskIntoConstraints = false
|
|
118
118
|
bannerView.tag = 2743243288699 // rand
|
|
119
|
-
self.
|
|
119
|
+
self.margin = margin
|
|
120
120
|
self.adPosition = adPosition
|
|
121
121
|
}
|
|
122
122
|
|
|
@@ -142,7 +142,7 @@ class BannerExecutor: NSObject, BannerViewDelegate {
|
|
|
142
142
|
toItem: rootViewController.view.safeAreaLayoutGuide,
|
|
143
143
|
attribute: self.adPosition == "TOP_CENTER" ? .top : .bottom,
|
|
144
144
|
multiplier: 1,
|
|
145
|
-
constant: CGFloat(Int(self.
|
|
145
|
+
constant: CGFloat(Int(self.margin) * -1)),
|
|
146
146
|
NSLayoutConstraint(item: bannerView,
|
|
147
147
|
attribute: .centerX,
|
|
148
148
|
relatedBy: .equal,
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
// Preserve existing public Swift API names.
|
|
2
|
+
// swiftlint:disable identifier_name
|
|
1
3
|
public enum AuthorizationStatusEnum: String {
|
|
2
4
|
case Authorized = "authorized"
|
|
3
5
|
case Denied = "denied"
|
|
4
6
|
case NotDetermined = "notDetermined"
|
|
5
7
|
case Restricted = "restricted"
|
|
6
8
|
}
|
|
9
|
+
// swiftlint:enable identifier_name
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// Preserve existing public Swift API names.
|
|
2
|
+
// swiftlint:disable identifier_name
|
|
1
3
|
public enum InterstitialAdPluginEvents: String {
|
|
2
4
|
case Loaded = "interstitialAdLoaded"
|
|
3
5
|
case FailedToLoad = "interstitialAdFailedToLoad"
|
|
@@ -6,3 +8,4 @@ public enum InterstitialAdPluginEvents: String {
|
|
|
6
8
|
case Dismissed = "interstitialAdDismissed"
|
|
7
9
|
case AdImpression = "interstitialAdImpression"
|
|
8
10
|
}
|
|
11
|
+
// swiftlint:enable identifier_name
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// Preserve existing public Swift API names.
|
|
2
|
+
// swiftlint:disable identifier_name
|
|
1
3
|
public enum RewardAdPluginEvents: String {
|
|
2
4
|
case adClicked = "onRewardedVideoAdClicked"
|
|
3
5
|
case Loaded = "onRewardedVideoAdLoaded"
|
|
@@ -8,3 +10,4 @@ public enum RewardAdPluginEvents: String {
|
|
|
8
10
|
case Rewarded = "onRewardedVideoAdReward"
|
|
9
11
|
case AdImpression = "onRewardedVideoAdImpression"
|
|
10
12
|
}
|
|
13
|
+
// swiftlint:enable identifier_name
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// Preserve existing public Swift API names.
|
|
2
|
+
// swiftlint:disable identifier_name
|
|
1
3
|
public enum RewardInterstitialAdPluginEvents: String {
|
|
2
4
|
case Loaded = "onRewardedInterstitialAdLoaded"
|
|
3
5
|
case FailedToLoad = "onRewardedInterstitialAdFailedToLoad"
|
|
@@ -7,3 +9,4 @@ public enum RewardInterstitialAdPluginEvents: String {
|
|
|
7
9
|
case Rewarded = "onRewardedInterstitialAdReward"
|
|
8
10
|
case AdImpression = "onRewardedInterstitialAdImpression"
|
|
9
11
|
}
|
|
12
|
+
// swiftlint:enable identifier_name
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor-community/admob",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "8.
|
|
4
|
+
"version": "8.3.0-beta.pr495.shaaa5aedc59a51",
|
|
5
5
|
"description": "A native plugin for AdMob",
|
|
6
6
|
"main": "dist/plugin.cjs.js",
|
|
7
7
|
"module": "dist/esm/index.js",
|
|
@@ -68,11 +68,13 @@
|
|
|
68
68
|
"rimraf": "^6.1.0",
|
|
69
69
|
"rollup": "^4.53.2",
|
|
70
70
|
"swiftlint": "^2.0.0",
|
|
71
|
-
"typescript": "^5.9.3"
|
|
71
|
+
"typescript": "^5.9.3",
|
|
72
|
+
"@rollup/plugin-node-resolve": "^16.0.3"
|
|
72
73
|
},
|
|
73
74
|
"dependencies": {
|
|
74
75
|
"@capacitor/core": "^8.0.0",
|
|
75
|
-
"@rdlabo/capacitor-docgen": "^0.4.1"
|
|
76
|
+
"@rdlabo/capacitor-docgen": "^0.4.1",
|
|
77
|
+
"@webview-native-ui/engine": "^1.0.0"
|
|
76
78
|
},
|
|
77
79
|
"lint-staged": {
|
|
78
80
|
"*.{ts}": [
|
|
@@ -85,7 +87,6 @@
|
|
|
85
87
|
]
|
|
86
88
|
},
|
|
87
89
|
"prettier": "@ionic/prettier-config",
|
|
88
|
-
"swiftlint": "@ionic/swiftlint-config",
|
|
89
90
|
"eslintConfig": {
|
|
90
91
|
"extends": "@ionic/eslint-config/recommended"
|
|
91
92
|
},
|