@ququplay/admob 7.0.3 → 8.0.0
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.swift +6 -4
- package/QuquplayAdmob.podspec +3 -2
- package/README.md +90 -39
- package/android/build.gradle +23 -22
- package/android/src/main/java/com/getcapacitor/community/admob/AdMob.java +5 -0
- package/android/src/main/java/com/getcapacitor/community/admob/banner/BannerExecutor.java +19 -0
- package/android/src/main/java/com/getcapacitor/community/admob/consent/AdConsentExecutor.java +47 -25
- package/android/src/main/java/com/getcapacitor/community/admob/interstitial/AdInterstitialExecutor.java +1 -1
- package/android/src/main/java/com/getcapacitor/community/admob/interstitial/InterstitialAdCallbackAndListeners.kt +2 -0
- package/android/src/main/java/com/getcapacitor/community/admob/rewarded/AdRewardExecutor.java +1 -1
- package/android/src/main/java/com/getcapacitor/community/admob/rewarded/RewardedAdCallbackAndListeners.kt +3 -0
- package/android/src/main/java/com/getcapacitor/community/admob/rewardedinterstitial/AdRewardInterstitialExecutor.java +1 -1
- package/dist/docs.json +422 -101
- package/dist/esm/banner/banner-definitions.interface.d.ts +1 -1
- package/dist/esm/consent/consent-debug-geography.enum.d.ts +10 -1
- package/dist/esm/consent/consent-debug-geography.enum.js +9 -0
- package/dist/esm/consent/consent-debug-geography.enum.js.map +1 -1
- package/dist/esm/consent/consent-definition.interface.d.ts +7 -0
- package/dist/esm/consent/consent-info.interface.d.ts +11 -0
- package/dist/esm/consent/privacy-options-requirement-status.enum.d.ts +19 -0
- package/dist/esm/consent/privacy-options-requirement-status.enum.js +21 -0
- package/dist/esm/consent/privacy-options-requirement-status.enum.js.map +1 -0
- package/dist/esm/definitions.d.ts +1 -2
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/interstitial/interstitial-definitions.interface.d.ts +1 -1
- package/dist/esm/private/validate-all-events-implemented.type.d.ts +8 -8
- package/dist/esm/reward/reward-ad-options.interface.d.ts +1 -1
- package/dist/esm/reward/reward-definitions.interface.d.ts +1 -1
- package/dist/esm/reward-interstitial/reward-interstitial-ad-options.interface.d.ts +1 -1
- package/dist/esm/reward-interstitial/reward-interstitial-definitions.interface.d.ts +1 -1
- package/dist/esm/shared/ad-options.interface.d.ts +11 -0
- package/dist/esm/web.d.ts +1 -0
- package/dist/esm/web.js +8 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +37 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +37 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/AdMobPlugin/AdMobPlugin.swift +26 -21
- package/ios/Sources/AdMobPlugin/Banner/BannerExecutor.swift +51 -59
- package/ios/Sources/AdMobPlugin/Consent/ConsentExecutor.swift +65 -45
- package/ios/Sources/AdMobPlugin/Interstitial/AdInterstitialExecutor.swift +9 -9
- package/ios/Sources/AdMobPlugin/Rewarded/AdRewardExecutor.swift +11 -11
- package/ios/Sources/AdMobPlugin/RewardedInterstitial/AdRewardInterstitialExecutor.swift +11 -11
- package/package.json +15 -15
- package/android/src/main/res/layout/bridge_layout_main.xml +0 -15
- package/android/src/main/res/values/colors.xml +0 -3
- package/android/src/main/res/values/strings.xml +0 -2
- package/android/src/main/res/values/styles.xml +0 -3
|
@@ -2,13 +2,13 @@ import Foundation
|
|
|
2
2
|
import Capacitor
|
|
3
3
|
import GoogleMobileAds
|
|
4
4
|
|
|
5
|
-
class AdRewardExecutor: NSObject,
|
|
5
|
+
class AdRewardExecutor: NSObject, FullScreenContentDelegate {
|
|
6
6
|
weak var plugin: AdMobPlugin?
|
|
7
|
-
var rewardedAd:
|
|
7
|
+
var rewardedAd: RewardedAd!
|
|
8
8
|
|
|
9
|
-
func prepareRewardVideoAd(_ call: CAPPluginCall, _ request:
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
func prepareRewardVideoAd(_ call: CAPPluginCall, _ request: Request, _ adUnitID: String) {
|
|
10
|
+
RewardedAd.load(
|
|
11
|
+
with: adUnitID,
|
|
12
12
|
request: request,
|
|
13
13
|
completionHandler: { (ad, error) in
|
|
14
14
|
if let error = error {
|
|
@@ -24,11 +24,11 @@ class AdRewardExecutor: NSObject, GADFullScreenContentDelegate {
|
|
|
24
24
|
self.rewardedAd = ad
|
|
25
25
|
|
|
26
26
|
if let providedOptions = call.getObject("ssv") {
|
|
27
|
-
let ssvOptions =
|
|
27
|
+
let ssvOptions = ServerSideVerificationOptions()
|
|
28
28
|
|
|
29
29
|
if let customData = providedOptions["customData"] as? String {
|
|
30
30
|
NSLog("Sending Custom Data: \(customData) to SSV callback")
|
|
31
|
-
ssvOptions.
|
|
31
|
+
ssvOptions.customRewardText = customData
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
if let userId = providedOptions["userId"] as? String {
|
|
@@ -53,7 +53,7 @@ class AdRewardExecutor: NSObject, GADFullScreenContentDelegate {
|
|
|
53
53
|
func showRewardVideoAd(_ call: CAPPluginCall) {
|
|
54
54
|
if let rootViewController = plugin?.getRootVC() {
|
|
55
55
|
if let ad = self.rewardedAd {
|
|
56
|
-
ad.present(
|
|
56
|
+
ad.present(from: rootViewController,
|
|
57
57
|
userDidEarnRewardHandler: {
|
|
58
58
|
let reward = ad.adReward
|
|
59
59
|
self.plugin?.notifyListeners(RewardAdPluginEvents.Rewarded.rawValue, data: ["type": reward.type, "amount": reward.amount])
|
|
@@ -66,7 +66,7 @@ class AdRewardExecutor: NSObject, GADFullScreenContentDelegate {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
func ad(_ ad:
|
|
69
|
+
func ad(_ ad: FullScreenPresentingAd, didFailToPresentFullScreenContentWithError error: Error) {
|
|
70
70
|
NSLog("RewardFullScreenDelegate Ad failed to present full screen content with error \(error.localizedDescription).")
|
|
71
71
|
self.plugin?.notifyListeners(RewardAdPluginEvents.FailedToShow.rawValue, data: [
|
|
72
72
|
"code": 0,
|
|
@@ -74,12 +74,12 @@ class AdRewardExecutor: NSObject, GADFullScreenContentDelegate {
|
|
|
74
74
|
])
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
func adWillPresentFullScreenContent(_ ad:
|
|
77
|
+
func adWillPresentFullScreenContent(_ ad: FullScreenPresentingAd) {
|
|
78
78
|
NSLog("RewardFullScreenDelegate Ad did present full screen content.")
|
|
79
79
|
self.plugin?.notifyListeners(RewardAdPluginEvents.Showed.rawValue, data: [:])
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
func adDidDismissFullScreenContent(_ ad:
|
|
82
|
+
func adDidDismissFullScreenContent(_ ad: FullScreenPresentingAd) {
|
|
83
83
|
NSLog("RewardFullScreenDelegate Ad did dismiss full screen content.")
|
|
84
84
|
self.plugin?.notifyListeners(RewardAdPluginEvents.Dismissed.rawValue, data: [:])
|
|
85
85
|
}
|
|
@@ -2,13 +2,13 @@ import Foundation
|
|
|
2
2
|
import Capacitor
|
|
3
3
|
import GoogleMobileAds
|
|
4
4
|
|
|
5
|
-
class AdRewardInterstitialExecutor: NSObject,
|
|
5
|
+
class AdRewardInterstitialExecutor: NSObject, FullScreenContentDelegate {
|
|
6
6
|
weak var plugin: AdMobPlugin?
|
|
7
|
-
var rewardedInterstitialAd:
|
|
7
|
+
var rewardedInterstitialAd: RewardedInterstitialAd!
|
|
8
8
|
|
|
9
|
-
func prepareRewardInterstitialAd(_ call: CAPPluginCall, _ request:
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
func prepareRewardInterstitialAd(_ call: CAPPluginCall, _ request: Request, _ adUnitID: String) {
|
|
10
|
+
RewardedInterstitialAd.load(
|
|
11
|
+
with: adUnitID,
|
|
12
12
|
request: request,
|
|
13
13
|
completionHandler: { (ad, error) in
|
|
14
14
|
if let error = error {
|
|
@@ -24,11 +24,11 @@ class AdRewardInterstitialExecutor: NSObject, GADFullScreenContentDelegate {
|
|
|
24
24
|
self.rewardedInterstitialAd = ad
|
|
25
25
|
|
|
26
26
|
if let providedOptions = call.getObject("ssv") {
|
|
27
|
-
let ssvOptions =
|
|
27
|
+
let ssvOptions = ServerSideVerificationOptions()
|
|
28
28
|
|
|
29
29
|
if let customData = providedOptions["customData"] as? String {
|
|
30
30
|
NSLog("Sending Custom Data: \(customData) to SSV callback")
|
|
31
|
-
ssvOptions.
|
|
31
|
+
ssvOptions.customRewardText = customData
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
if let userId = providedOptions["userId"] as? String {
|
|
@@ -53,7 +53,7 @@ class AdRewardInterstitialExecutor: NSObject, GADFullScreenContentDelegate {
|
|
|
53
53
|
func showRewardInterstitialAd(_ call: CAPPluginCall) {
|
|
54
54
|
if let rootViewController = plugin?.getRootVC() {
|
|
55
55
|
if let ad = self.rewardedInterstitialAd {
|
|
56
|
-
ad.present(
|
|
56
|
+
ad.present(from: rootViewController,
|
|
57
57
|
userDidEarnRewardHandler: {
|
|
58
58
|
let reward = ad.adReward
|
|
59
59
|
self.plugin?.notifyListeners(RewardInterstitialAdPluginEvents.Rewarded.rawValue, data: ["type": reward.type, "amount": reward.amount])
|
|
@@ -66,7 +66,7 @@ class AdRewardInterstitialExecutor: NSObject, GADFullScreenContentDelegate {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
func ad(_ ad:
|
|
69
|
+
func ad(_ ad: FullScreenPresentingAd, didFailToPresentFullScreenContentWithError error: Error) {
|
|
70
70
|
NSLog("RewardFullScreenDelegate Ad failed to present full screen content with error \(error.localizedDescription).")
|
|
71
71
|
self.plugin?.notifyListeners(RewardInterstitialAdPluginEvents.FailedToShow.rawValue, data: [
|
|
72
72
|
"code": 0,
|
|
@@ -74,12 +74,12 @@ class AdRewardInterstitialExecutor: NSObject, GADFullScreenContentDelegate {
|
|
|
74
74
|
])
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
func adWillPresentFullScreenContent(_ ad:
|
|
77
|
+
func adWillPresentFullScreenContent(_ ad: FullScreenPresentingAd) {
|
|
78
78
|
NSLog("RewardFullScreenDelegate Ad did present full screen content.")
|
|
79
79
|
self.plugin?.notifyListeners(RewardInterstitialAdPluginEvents.Showed.rawValue, data: [:])
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
func adDidDismissFullScreenContent(_ ad:
|
|
82
|
+
func adDidDismissFullScreenContent(_ ad: FullScreenPresentingAd) {
|
|
83
83
|
NSLog("RewardFullScreenDelegate Ad did dismiss full screen content.")
|
|
84
84
|
self.plugin?.notifyListeners(RewardInterstitialAdPluginEvents.Dismissed.rawValue, data: [:])
|
|
85
85
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ququplay/admob",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "A native plugin for AdMob",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/esm/index.d.ts",
|
|
8
8
|
"unpkg": "dist/plugin.js",
|
|
9
9
|
"engines": {
|
|
10
|
-
"node": ">=
|
|
10
|
+
"node": ">=22.0.0"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
13
|
"android/src/main/",
|
|
@@ -42,33 +42,33 @@
|
|
|
42
42
|
"clean": "rimraf ./dist",
|
|
43
43
|
"watch": "tsc --watch",
|
|
44
44
|
"prepublishOnly": "npm run build",
|
|
45
|
-
"release": "np --no-tests --
|
|
45
|
+
"release": "np --no-tests --no-publish",
|
|
46
46
|
"prepare": "husky"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@capacitor/android": "^
|
|
50
|
-
"@capacitor/cli": "^
|
|
51
|
-
"@capacitor/core": "^
|
|
52
|
-
"@capacitor/
|
|
53
|
-
"@capacitor/ios": "^7.0.0",
|
|
49
|
+
"@capacitor/android": "^8.0.0",
|
|
50
|
+
"@capacitor/cli": "^8.0.0",
|
|
51
|
+
"@capacitor/core": "^8.0.0",
|
|
52
|
+
"@capacitor/ios": "^8.0.0",
|
|
54
53
|
"@ionic/eslint-config": "^0.4.0",
|
|
55
54
|
"@ionic/prettier-config": "^4.0.0",
|
|
56
55
|
"@ionic/swiftlint-config": "^2.0.0",
|
|
57
56
|
"@typescript-eslint/eslint-plugin": "^5.27.1",
|
|
58
|
-
"eslint": "^8.57.
|
|
57
|
+
"eslint": "^8.57.1",
|
|
59
58
|
"husky": "^9.1.7",
|
|
60
59
|
"lint-staged": "^15.2.10",
|
|
61
60
|
"np": "^8.0.4",
|
|
62
61
|
"pre-commit": "^1.2.2",
|
|
63
|
-
"prettier": "^3.
|
|
64
|
-
"prettier-plugin-java": "^2.
|
|
65
|
-
"rimraf": "^6.0
|
|
66
|
-
"rollup": "^4.
|
|
62
|
+
"prettier": "^3.6.2",
|
|
63
|
+
"prettier-plugin-java": "^2.7.7",
|
|
64
|
+
"rimraf": "^6.1.0",
|
|
65
|
+
"rollup": "^4.53.2",
|
|
67
66
|
"swiftlint": "^2.0.0",
|
|
68
|
-
"typescript": "
|
|
67
|
+
"typescript": "^5.9.3"
|
|
69
68
|
},
|
|
70
69
|
"dependencies": {
|
|
71
|
-
"@capacitor/core": "^
|
|
70
|
+
"@capacitor/core": "^8.0.0",
|
|
71
|
+
"@rdlabo/capacitor-docgen": "^0.4.1"
|
|
72
72
|
},
|
|
73
73
|
"lint-staged": {
|
|
74
74
|
"*.{ts}": [
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
-
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
4
|
-
xmlns:tools="http://schemas.android.com/tools"
|
|
5
|
-
android:layout_width="match_parent"
|
|
6
|
-
android:layout_height="match_parent"
|
|
7
|
-
tools:context="com.getcapacitor.BridgeActivity"
|
|
8
|
-
>
|
|
9
|
-
|
|
10
|
-
<WebView
|
|
11
|
-
android:id="@+id/webview"
|
|
12
|
-
android:layout_width="fill_parent"
|
|
13
|
-
android:layout_height="fill_parent" />
|
|
14
|
-
|
|
15
|
-
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|