@ququplay/admob 5.3.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.
Files changed (140) hide show
  1. package/CapacitorCommunityAdmob.podspec +19 -0
  2. package/LICENSE +21 -0
  3. package/README.md +1091 -0
  4. package/android/build.gradle +92 -0
  5. package/android/src/main/AndroidManifest.xml +5 -0
  6. package/android/src/main/java/com/getcapacitor/community/admob/AdMob.java +240 -0
  7. package/android/src/main/java/com/getcapacitor/community/admob/banner/BannerAdPluginEvents.kt +11 -0
  8. package/android/src/main/java/com/getcapacitor/community/admob/banner/BannerAdSizeEnum.kt +20 -0
  9. package/android/src/main/java/com/getcapacitor/community/admob/banner/BannerAdSizeInfo.kt +17 -0
  10. package/android/src/main/java/com/getcapacitor/community/admob/banner/BannerExecutor.java +294 -0
  11. package/android/src/main/java/com/getcapacitor/community/admob/consent/AdConsentExecutor.java +232 -0
  12. package/android/src/main/java/com/getcapacitor/community/admob/helpers/AdViewIdHelper.java +31 -0
  13. package/android/src/main/java/com/getcapacitor/community/admob/helpers/AuthorizationStatusEnum.kt +5 -0
  14. package/android/src/main/java/com/getcapacitor/community/admob/helpers/FullscreenPluginCallback.kt +27 -0
  15. package/android/src/main/java/com/getcapacitor/community/admob/helpers/RequestHelper.java +49 -0
  16. package/android/src/main/java/com/getcapacitor/community/admob/interstitial/AdInterstitialExecutor.java +80 -0
  17. package/android/src/main/java/com/getcapacitor/community/admob/interstitial/InterstitialAdCallbackAndListeners.kt +38 -0
  18. package/android/src/main/java/com/getcapacitor/community/admob/interstitial/InterstitialAdPluginPluginEvent.kt +11 -0
  19. package/android/src/main/java/com/getcapacitor/community/admob/models/AdMobPluginError.kt +15 -0
  20. package/android/src/main/java/com/getcapacitor/community/admob/models/AdOptions.java +225 -0
  21. package/android/src/main/java/com/getcapacitor/community/admob/models/Executor.java +34 -0
  22. package/android/src/main/java/com/getcapacitor/community/admob/models/LoadPluginEventNames.kt +7 -0
  23. package/android/src/main/java/com/getcapacitor/community/admob/rewarded/AdRewardExecutor.java +80 -0
  24. package/android/src/main/java/com/getcapacitor/community/admob/rewarded/RewardAdPluginEvents.kt +12 -0
  25. package/android/src/main/java/com/getcapacitor/community/admob/rewarded/RewardedAdCallbackAndListeners.kt +63 -0
  26. package/android/src/main/java/com/getcapacitor/community/admob/rewarded/models/SsvInfo.kt +20 -0
  27. package/android/src/main/res/layout/bridge_layout_main.xml +15 -0
  28. package/android/src/main/res/values/colors.xml +3 -0
  29. package/android/src/main/res/values/strings.xml +2 -0
  30. package/android/src/main/res/values/styles.xml +3 -0
  31. package/dist/docs.json +2467 -0
  32. package/dist/esm/banner/banner-ad-options.interface.d.ts +25 -0
  33. package/dist/esm/banner/banner-ad-options.interface.js +2 -0
  34. package/dist/esm/banner/banner-ad-options.interface.js.map +1 -0
  35. package/dist/esm/banner/banner-ad-plugin-events.enum.d.ts +17 -0
  36. package/dist/esm/banner/banner-ad-plugin-events.enum.js +20 -0
  37. package/dist/esm/banner/banner-ad-plugin-events.enum.js.map +1 -0
  38. package/dist/esm/banner/banner-ad-position.enum.d.ts +17 -0
  39. package/dist/esm/banner/banner-ad-position.enum.js +19 -0
  40. package/dist/esm/banner/banner-ad-position.enum.js.map +1 -0
  41. package/dist/esm/banner/banner-ad-size.enum.d.ts +42 -0
  42. package/dist/esm/banner/banner-ad-size.enum.js +44 -0
  43. package/dist/esm/banner/banner-ad-size.enum.js.map +1 -0
  44. package/dist/esm/banner/banner-definitions.interface.d.ts +91 -0
  45. package/dist/esm/banner/banner-definitions.interface.js +2 -0
  46. package/dist/esm/banner/banner-definitions.interface.js.map +1 -0
  47. package/dist/esm/banner/banner-size.interface.d.ts +7 -0
  48. package/dist/esm/banner/banner-size.interface.js +2 -0
  49. package/dist/esm/banner/banner-size.interface.js.map +1 -0
  50. package/dist/esm/banner/index.d.ts +6 -0
  51. package/dist/esm/banner/index.js +7 -0
  52. package/dist/esm/banner/index.js.map +1 -0
  53. package/dist/esm/consent/consent-debug-geography.enum.d.ts +19 -0
  54. package/dist/esm/consent/consent-debug-geography.enum.js +21 -0
  55. package/dist/esm/consent/consent-debug-geography.enum.js.map +1 -0
  56. package/dist/esm/consent/consent-definition.interface.d.ts +26 -0
  57. package/dist/esm/consent/consent-definition.interface.js +2 -0
  58. package/dist/esm/consent/consent-definition.interface.js.map +1 -0
  59. package/dist/esm/consent/consent-info.interface.d.ts +13 -0
  60. package/dist/esm/consent/consent-info.interface.js +2 -0
  61. package/dist/esm/consent/consent-info.interface.js.map +1 -0
  62. package/dist/esm/consent/consent-request-options.interface.d.ts +20 -0
  63. package/dist/esm/consent/consent-request-options.interface.js +2 -0
  64. package/dist/esm/consent/consent-request-options.interface.js.map +1 -0
  65. package/dist/esm/consent/consent-status.enum.d.ts +23 -0
  66. package/dist/esm/consent/consent-status.enum.js +25 -0
  67. package/dist/esm/consent/consent-status.enum.js.map +1 -0
  68. package/dist/esm/consent/index.d.ts +5 -0
  69. package/dist/esm/consent/index.js +6 -0
  70. package/dist/esm/consent/index.js.map +1 -0
  71. package/dist/esm/definitions.d.ts +129 -0
  72. package/dist/esm/definitions.js +20 -0
  73. package/dist/esm/definitions.js.map +1 -0
  74. package/dist/esm/index.d.ts +9 -0
  75. package/dist/esm/index.js +12 -0
  76. package/dist/esm/index.js.map +1 -0
  77. package/dist/esm/interstitial/index.d.ts +2 -0
  78. package/dist/esm/interstitial/index.js +3 -0
  79. package/dist/esm/interstitial/index.js.map +1 -0
  80. package/dist/esm/interstitial/interstitial-ad-plugin-events.enum.d.ts +22 -0
  81. package/dist/esm/interstitial/interstitial-ad-plugin-events.enum.js +25 -0
  82. package/dist/esm/interstitial/interstitial-ad-plugin-events.enum.js.map +1 -0
  83. package/dist/esm/interstitial/interstitial-definitions.interface.d.ts +27 -0
  84. package/dist/esm/interstitial/interstitial-definitions.interface.js +2 -0
  85. package/dist/esm/interstitial/interstitial-definitions.interface.js.map +1 -0
  86. package/dist/esm/private/validate-all-events-implemented.type.d.ts +12 -0
  87. package/dist/esm/private/validate-all-events-implemented.type.js +2 -0
  88. package/dist/esm/private/validate-all-events-implemented.type.js.map +1 -0
  89. package/dist/esm/reward/index.d.ts +4 -0
  90. package/dist/esm/reward/index.js +5 -0
  91. package/dist/esm/reward/index.js.map +1 -0
  92. package/dist/esm/reward/reward-ad-options.interface.d.ts +25 -0
  93. package/dist/esm/reward/reward-ad-options.interface.js +2 -0
  94. package/dist/esm/reward/reward-ad-options.interface.js.map +1 -0
  95. package/dist/esm/reward/reward-ad-plugin-events.enum.d.ts +32 -0
  96. package/dist/esm/reward/reward-ad-plugin-events.enum.js +35 -0
  97. package/dist/esm/reward/reward-ad-plugin-events.enum.js.map +1 -0
  98. package/dist/esm/reward/reward-definitions.interface.d.ts +30 -0
  99. package/dist/esm/reward/reward-definitions.interface.js +2 -0
  100. package/dist/esm/reward/reward-definitions.interface.js.map +1 -0
  101. package/dist/esm/reward/reward-item.interface.d.ts +14 -0
  102. package/dist/esm/reward/reward-item.interface.js +2 -0
  103. package/dist/esm/reward/reward-item.interface.js.map +1 -0
  104. package/dist/esm/shared/ad-load-info.interface.d.ts +3 -0
  105. package/dist/esm/shared/ad-load-info.interface.js +2 -0
  106. package/dist/esm/shared/ad-load-info.interface.js.map +1 -0
  107. package/dist/esm/shared/ad-options.interface.d.ts +35 -0
  108. package/dist/esm/shared/ad-options.interface.js +2 -0
  109. package/dist/esm/shared/ad-options.interface.js.map +1 -0
  110. package/dist/esm/shared/admob-error.interface.d.ts +14 -0
  111. package/dist/esm/shared/admob-error.interface.js +2 -0
  112. package/dist/esm/shared/admob-error.interface.js.map +1 -0
  113. package/dist/esm/shared/index.d.ts +3 -0
  114. package/dist/esm/shared/index.js +4 -0
  115. package/dist/esm/shared/index.js.map +1 -0
  116. package/dist/esm/shared/tracking-authorization-status.interface.d.ts +6 -0
  117. package/dist/esm/shared/tracking-authorization-status.interface.js +2 -0
  118. package/dist/esm/shared/tracking-authorization-status.interface.js.map +1 -0
  119. package/dist/esm/web.d.ts +25 -0
  120. package/dist/esm/web.js +83 -0
  121. package/dist/esm/web.js.map +1 -0
  122. package/dist/plugin.cjs.js +307 -0
  123. package/dist/plugin.cjs.js.map +1 -0
  124. package/dist/plugin.js +310 -0
  125. package/dist/plugin.js.map +1 -0
  126. package/ios/Plugin/Banner/BannerAdPluginEvents.swift +8 -0
  127. package/ios/Plugin/Banner/BannerAdSizeEnum.swift +10 -0
  128. package/ios/Plugin/Banner/BannerExecutor.swift +198 -0
  129. package/ios/Plugin/Consent/ConsentExecutor.swift +158 -0
  130. package/ios/Plugin/Helper/AuthorizationStatusEnum.swift +6 -0
  131. package/ios/Plugin/Info.plist +24 -0
  132. package/ios/Plugin/Interstitial/AdInterstitialExecutor.swift +65 -0
  133. package/ios/Plugin/Interstitial/InterstitialAdPluginEvents.swift +7 -0
  134. package/ios/Plugin/Models/FullScreenAdEventName.swift +12 -0
  135. package/ios/Plugin/Plugin.h +10 -0
  136. package/ios/Plugin/Plugin.m +23 -0
  137. package/ios/Plugin/Plugin.swift +275 -0
  138. package/ios/Plugin/Rewarded/AdRewardExecutor.swift +86 -0
  139. package/ios/Plugin/Rewarded/RewardAdPluginEvents.swift +8 -0
  140. package/package.json +108 -0
package/dist/plugin.js ADDED
@@ -0,0 +1,310 @@
1
+ var AdMobPlugin = (function (exports, core) {
2
+ 'use strict';
3
+
4
+ exports.MaxAdContentRating = void 0;
5
+ (function (MaxAdContentRating) {
6
+ /**
7
+ * Content suitable for general audiences, including families.
8
+ */
9
+ MaxAdContentRating["General"] = "General";
10
+ /**
11
+ * Content suitable for most audiences with parental guidance.
12
+ */
13
+ MaxAdContentRating["ParentalGuidance"] = "ParentalGuidance";
14
+ /**
15
+ * Content suitable for teen and older audiences.
16
+ */
17
+ MaxAdContentRating["Teen"] = "Teen";
18
+ /**
19
+ * Content suitable only for mature audiences.
20
+ */
21
+ MaxAdContentRating["MatureAudience"] = "MatureAudience";
22
+ })(exports.MaxAdContentRating || (exports.MaxAdContentRating = {}));
23
+
24
+ // This enum should be keep in sync with their native equivalents with the same name
25
+ exports.BannerAdPluginEvents = void 0;
26
+ (function (BannerAdPluginEvents) {
27
+ BannerAdPluginEvents["SizeChanged"] = "bannerAdSizeChanged";
28
+ BannerAdPluginEvents["Loaded"] = "bannerAdLoaded";
29
+ BannerAdPluginEvents["FailedToLoad"] = "bannerAdFailedToLoad";
30
+ /**
31
+ * Open "Adsense" Event after user click banner
32
+ */
33
+ BannerAdPluginEvents["Opened"] = "bannerAdOpened";
34
+ /**
35
+ * Close "Adsense" Event after user click banner
36
+ */
37
+ BannerAdPluginEvents["Closed"] = "bannerAdClosed";
38
+ /**
39
+ * Similarly, this method should be called when an impression is recorded for the ad by the mediated SDK.
40
+ */
41
+ BannerAdPluginEvents["AdImpression"] = "bannerAdImpression";
42
+ })(exports.BannerAdPluginEvents || (exports.BannerAdPluginEvents = {}));
43
+
44
+ /**
45
+ * @see https://developer.android.com/reference/android/widget/LinearLayout#attr_android:gravity
46
+ */
47
+ exports.BannerAdPosition = void 0;
48
+ (function (BannerAdPosition) {
49
+ /**
50
+ * Banner position be top-center
51
+ */
52
+ BannerAdPosition["TOP_CENTER"] = "TOP_CENTER";
53
+ /**
54
+ * Banner position be center
55
+ */
56
+ BannerAdPosition["CENTER"] = "CENTER";
57
+ /**
58
+ * Banner position be bottom-center(default)
59
+ */
60
+ BannerAdPosition["BOTTOM_CENTER"] = "BOTTOM_CENTER";
61
+ })(exports.BannerAdPosition || (exports.BannerAdPosition = {}));
62
+
63
+ /**
64
+ * For more information:
65
+ * https://developers.google.com/admob/ios/banner#banner_sizes
66
+ * https://developers.google.com/android/reference/com/google/android/gms/ads/AdSize
67
+ *
68
+ * */
69
+ exports.BannerAdSize = void 0;
70
+ (function (BannerAdSize) {
71
+ /**
72
+ * Mobile Marketing Association (MMA)
73
+ * banner ad size (320x50 density-independent pixels).
74
+ */
75
+ BannerAdSize["BANNER"] = "BANNER";
76
+ /**
77
+ * Interactive Advertising Bureau (IAB)
78
+ * full banner ad size (468x60 density-independent pixels).
79
+ */
80
+ BannerAdSize["FULL_BANNER"] = "FULL_BANNER";
81
+ /**
82
+ * Large banner ad size (320x100 density-independent pixels).
83
+ */
84
+ BannerAdSize["LARGE_BANNER"] = "LARGE_BANNER";
85
+ /**
86
+ * Interactive Advertising Bureau (IAB)
87
+ * medium rectangle ad size (300x250 density-independent pixels).
88
+ */
89
+ BannerAdSize["MEDIUM_RECTANGLE"] = "MEDIUM_RECTANGLE";
90
+ /**
91
+ * Interactive Advertising Bureau (IAB)
92
+ * leaderboard ad size (728x90 density-independent pixels).
93
+ */
94
+ BannerAdSize["LEADERBOARD"] = "LEADERBOARD";
95
+ /**
96
+ * A dynamically sized banner that is full-width and auto-height.
97
+ */
98
+ BannerAdSize["ADAPTIVE_BANNER"] = "ADAPTIVE_BANNER";
99
+ /**
100
+ * @deprecated
101
+ * Will be removed in next AdMob versions use `ADAPTIVE_BANNER`
102
+ * Screen width x 32|50|90
103
+ */
104
+ BannerAdSize["SMART_BANNER"] = "SMART_BANNER";
105
+ })(exports.BannerAdSize || (exports.BannerAdSize = {}));
106
+
107
+ // This enum should be keep in sync with their native equivalents with the same name
108
+ exports.InterstitialAdPluginEvents = void 0;
109
+ (function (InterstitialAdPluginEvents) {
110
+ /**
111
+ * Emits after trying to prepare and Interstitial, when it is loaded and ready to be show
112
+ */
113
+ InterstitialAdPluginEvents["Loaded"] = "interstitialAdLoaded";
114
+ /**
115
+ * Emits after trying to prepare and Interstitial, when it could not be loaded
116
+ */
117
+ InterstitialAdPluginEvents["FailedToLoad"] = "interstitialAdFailedToLoad";
118
+ /**
119
+ * Emits when the Interstitial ad is visible to the user
120
+ */
121
+ InterstitialAdPluginEvents["Showed"] = "interstitialAdShowed";
122
+ /**
123
+ * Emits when the Interstitial ad is failed to show
124
+ */
125
+ InterstitialAdPluginEvents["FailedToShow"] = "interstitialAdFailedToShow";
126
+ /**
127
+ * Emits when the Interstitial ad is not visible to the user anymore.
128
+ */
129
+ InterstitialAdPluginEvents["Dismissed"] = "interstitialAdDismissed";
130
+ })(exports.InterstitialAdPluginEvents || (exports.InterstitialAdPluginEvents = {}));
131
+
132
+ // This enum should be keep in sync with their native equivalents with the same name
133
+ exports.RewardAdPluginEvents = void 0;
134
+ (function (RewardAdPluginEvents) {
135
+ /**
136
+ * Emits after trying to prepare a RewardAd and the Video is loaded and ready to be show
137
+ */
138
+ RewardAdPluginEvents["Loaded"] = "onRewardedVideoAdLoaded";
139
+ /**
140
+ * Emits after trying to prepare a RewardAd when it could not be loaded
141
+ */
142
+ RewardAdPluginEvents["FailedToLoad"] = "onRewardedVideoAdFailedToLoad";
143
+ /**
144
+ * Emits when the AdReward video is visible to the user
145
+ */
146
+ RewardAdPluginEvents["Showed"] = "onRewardedVideoAdShowed";
147
+ /**
148
+ * Emits when the AdReward video is failed to show
149
+ */
150
+ RewardAdPluginEvents["FailedToShow"] = "onRewardedVideoAdFailedToShow";
151
+ /**
152
+ * Emits when the AdReward video is not visible to the user anymore.
153
+ *
154
+ * **Important**: This has nothing to do with the reward it self. This event
155
+ * will emits in this two cases:
156
+ * 1. The user starts the video ad but close it before the reward emit.
157
+ * 2. The user start the video and see it until end, then gets the reward
158
+ * and after that the ad is closed.
159
+ */
160
+ RewardAdPluginEvents["Dismissed"] = "onRewardedVideoAdDismissed";
161
+ /**
162
+ * Emits when user get rewarded from AdReward
163
+ */
164
+ RewardAdPluginEvents["Rewarded"] = "onRewardedVideoAdReward";
165
+ })(exports.RewardAdPluginEvents || (exports.RewardAdPluginEvents = {}));
166
+
167
+ /**
168
+ * For more information:
169
+ * https://developers.google.com/admob/unity/reference/namespace/google-mobile-ads/ump/api#consentstatus
170
+ *
171
+ * */
172
+ exports.AdmobConsentStatus = void 0;
173
+ (function (AdmobConsentStatus) {
174
+ /**
175
+ * User consent not required.
176
+ */
177
+ AdmobConsentStatus["NOT_REQUIRED"] = "NOT_REQUIRED";
178
+ /**
179
+ * User consent already obtained.
180
+ */
181
+ AdmobConsentStatus["OBTAINED"] = "OBTAINED";
182
+ /**
183
+ * User consent required but not yet obtained.
184
+ */
185
+ AdmobConsentStatus["REQUIRED"] = "REQUIRED";
186
+ /**
187
+ * Unknown consent status, AdsConsent.requestInfoUpdate needs to be called to update it.
188
+ */
189
+ AdmobConsentStatus["UNKNOWN"] = "UNKNOWN";
190
+ })(exports.AdmobConsentStatus || (exports.AdmobConsentStatus = {}));
191
+
192
+ /**
193
+ * For more information:
194
+ * https://developers.google.com/admob/unity/reference/namespace/google-mobile-ads/ump/api#debuggeography
195
+ *
196
+ * */
197
+ exports.AdmobConsentDebugGeography = void 0;
198
+ (function (AdmobConsentDebugGeography) {
199
+ /**
200
+ * Debug geography disabled.
201
+ */
202
+ AdmobConsentDebugGeography[AdmobConsentDebugGeography["DISABLED"] = 0] = "DISABLED";
203
+ /**
204
+ * Geography appears as in EEA for debug devices.
205
+ */
206
+ AdmobConsentDebugGeography[AdmobConsentDebugGeography["EEA"] = 1] = "EEA";
207
+ /**
208
+ * Geography appears as not in EEA for debug devices.
209
+ */
210
+ AdmobConsentDebugGeography[AdmobConsentDebugGeography["NOT_EEA"] = 2] = "NOT_EEA";
211
+ })(exports.AdmobConsentDebugGeography || (exports.AdmobConsentDebugGeography = {}));
212
+
213
+ const AdMob = core.registerPlugin('AdMob', {
214
+ web: () => Promise.resolve().then(function () { return web; }).then(m => new m.AdMobWeb()),
215
+ });
216
+
217
+ class AdMobWeb extends core.WebPlugin {
218
+ constructor() {
219
+ super({
220
+ name: 'AdMob',
221
+ platforms: ['web'],
222
+ });
223
+ }
224
+ async initialize() {
225
+ console.log('initialize');
226
+ }
227
+ async targetSettings() {
228
+ console.log('targetSettings');
229
+ }
230
+ async requestTrackingAuthorization() {
231
+ console.log('requestTrackingAuthorization');
232
+ }
233
+ async trackingAuthorizationStatus() {
234
+ return {
235
+ status: 'authorized',
236
+ };
237
+ }
238
+ async requestConsentInfo(options) {
239
+ console.log('requestConsentInfo', options);
240
+ return {
241
+ status: exports.AdmobConsentStatus.REQUIRED,
242
+ isConsentFormAvailable: true,
243
+ };
244
+ }
245
+ async showConsentForm() {
246
+ console.log('showConsentForm');
247
+ return {
248
+ status: exports.AdmobConsentStatus.REQUIRED,
249
+ };
250
+ }
251
+ async resetConsentInfo() {
252
+ console.log('resetConsentInfo');
253
+ }
254
+ async setApplicationMuted(options) {
255
+ console.log('setApplicationMuted', options);
256
+ }
257
+ async setApplicationVolume(options) {
258
+ console.log('setApplicationVolume', options);
259
+ }
260
+ async showBanner(options) {
261
+ console.log('showBanner', options);
262
+ }
263
+ // Hide the banner, remove it from screen, but can show it later
264
+ async hideBanner() {
265
+ console.log('hideBanner');
266
+ }
267
+ // Resume the banner, show it after hide
268
+ async resumeBanner() {
269
+ console.log('resumeBanner');
270
+ }
271
+ // Destroy the banner, remove it from screen.
272
+ async removeBanner() {
273
+ console.log('removeBanner');
274
+ }
275
+ async prepareInterstitial(options) {
276
+ console.log('prepareInterstitial', options);
277
+ return {
278
+ adUnitId: options.adId,
279
+ };
280
+ }
281
+ async showInterstitial() {
282
+ console.log('showInterstitial');
283
+ }
284
+ async prepareRewardVideoAd(options) {
285
+ console.log(options);
286
+ return {
287
+ adUnitId: options.adId,
288
+ };
289
+ }
290
+ async showRewardVideoAd() {
291
+ return {
292
+ type: '',
293
+ amount: 0,
294
+ };
295
+ }
296
+ }
297
+
298
+ var web = /*#__PURE__*/Object.freeze({
299
+ __proto__: null,
300
+ AdMobWeb: AdMobWeb
301
+ });
302
+
303
+ exports.AdMob = AdMob;
304
+
305
+ Object.defineProperty(exports, '__esModule', { value: true });
306
+
307
+ return exports;
308
+
309
+ })({}, capacitorExports);
310
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/banner/banner-ad-plugin-events.enum.js","esm/banner/banner-ad-position.enum.js","esm/banner/banner-ad-size.enum.js","esm/interstitial/interstitial-ad-plugin-events.enum.js","esm/reward/reward-ad-plugin-events.enum.js","esm/consent/consent-status.enum.js","esm/consent/consent-debug-geography.enum.js","esm/index.js","esm/web.js"],"sourcesContent":["export var MaxAdContentRating;\n(function (MaxAdContentRating) {\n /**\n * Content suitable for general audiences, including families.\n */\n MaxAdContentRating[\"General\"] = \"General\";\n /**\n * Content suitable for most audiences with parental guidance.\n */\n MaxAdContentRating[\"ParentalGuidance\"] = \"ParentalGuidance\";\n /**\n * Content suitable for teen and older audiences.\n */\n MaxAdContentRating[\"Teen\"] = \"Teen\";\n /**\n * Content suitable only for mature audiences.\n */\n MaxAdContentRating[\"MatureAudience\"] = \"MatureAudience\";\n})(MaxAdContentRating || (MaxAdContentRating = {}));\n//# sourceMappingURL=definitions.js.map","// This enum should be keep in sync with their native equivalents with the same name\nexport var BannerAdPluginEvents;\n(function (BannerAdPluginEvents) {\n BannerAdPluginEvents[\"SizeChanged\"] = \"bannerAdSizeChanged\";\n BannerAdPluginEvents[\"Loaded\"] = \"bannerAdLoaded\";\n BannerAdPluginEvents[\"FailedToLoad\"] = \"bannerAdFailedToLoad\";\n /**\n * Open \"Adsense\" Event after user click banner\n */\n BannerAdPluginEvents[\"Opened\"] = \"bannerAdOpened\";\n /**\n * Close \"Adsense\" Event after user click banner\n */\n BannerAdPluginEvents[\"Closed\"] = \"bannerAdClosed\";\n /**\n * Similarly, this method should be called when an impression is recorded for the ad by the mediated SDK.\n */\n BannerAdPluginEvents[\"AdImpression\"] = \"bannerAdImpression\";\n})(BannerAdPluginEvents || (BannerAdPluginEvents = {}));\n//# sourceMappingURL=banner-ad-plugin-events.enum.js.map","/**\n * @see https://developer.android.com/reference/android/widget/LinearLayout#attr_android:gravity\n */\nexport var BannerAdPosition;\n(function (BannerAdPosition) {\n /**\n * Banner position be top-center\n */\n BannerAdPosition[\"TOP_CENTER\"] = \"TOP_CENTER\";\n /**\n * Banner position be center\n */\n BannerAdPosition[\"CENTER\"] = \"CENTER\";\n /**\n * Banner position be bottom-center(default)\n */\n BannerAdPosition[\"BOTTOM_CENTER\"] = \"BOTTOM_CENTER\";\n})(BannerAdPosition || (BannerAdPosition = {}));\n//# sourceMappingURL=banner-ad-position.enum.js.map","/**\n * For more information:\n * https://developers.google.com/admob/ios/banner#banner_sizes\n * https://developers.google.com/android/reference/com/google/android/gms/ads/AdSize\n *\n * */\nexport var BannerAdSize;\n(function (BannerAdSize) {\n /**\n * Mobile Marketing Association (MMA)\n * banner ad size (320x50 density-independent pixels).\n */\n BannerAdSize[\"BANNER\"] = \"BANNER\";\n /**\n * Interactive Advertising Bureau (IAB)\n * full banner ad size (468x60 density-independent pixels).\n */\n BannerAdSize[\"FULL_BANNER\"] = \"FULL_BANNER\";\n /**\n * Large banner ad size (320x100 density-independent pixels).\n */\n BannerAdSize[\"LARGE_BANNER\"] = \"LARGE_BANNER\";\n /**\n * Interactive Advertising Bureau (IAB)\n * medium rectangle ad size (300x250 density-independent pixels).\n */\n BannerAdSize[\"MEDIUM_RECTANGLE\"] = \"MEDIUM_RECTANGLE\";\n /**\n * Interactive Advertising Bureau (IAB)\n * leaderboard ad size (728x90 density-independent pixels).\n */\n BannerAdSize[\"LEADERBOARD\"] = \"LEADERBOARD\";\n /**\n * A dynamically sized banner that is full-width and auto-height.\n */\n BannerAdSize[\"ADAPTIVE_BANNER\"] = \"ADAPTIVE_BANNER\";\n /**\n * @deprecated\n * Will be removed in next AdMob versions use `ADAPTIVE_BANNER`\n * Screen width x 32|50|90\n */\n BannerAdSize[\"SMART_BANNER\"] = \"SMART_BANNER\";\n})(BannerAdSize || (BannerAdSize = {}));\n//# sourceMappingURL=banner-ad-size.enum.js.map","// This enum should be keep in sync with their native equivalents with the same name\nexport var InterstitialAdPluginEvents;\n(function (InterstitialAdPluginEvents) {\n /**\n * Emits after trying to prepare and Interstitial, when it is loaded and ready to be show\n */\n InterstitialAdPluginEvents[\"Loaded\"] = \"interstitialAdLoaded\";\n /**\n * Emits after trying to prepare and Interstitial, when it could not be loaded\n */\n InterstitialAdPluginEvents[\"FailedToLoad\"] = \"interstitialAdFailedToLoad\";\n /**\n * Emits when the Interstitial ad is visible to the user\n */\n InterstitialAdPluginEvents[\"Showed\"] = \"interstitialAdShowed\";\n /**\n * Emits when the Interstitial ad is failed to show\n */\n InterstitialAdPluginEvents[\"FailedToShow\"] = \"interstitialAdFailedToShow\";\n /**\n * Emits when the Interstitial ad is not visible to the user anymore.\n */\n InterstitialAdPluginEvents[\"Dismissed\"] = \"interstitialAdDismissed\";\n})(InterstitialAdPluginEvents || (InterstitialAdPluginEvents = {}));\n//# sourceMappingURL=interstitial-ad-plugin-events.enum.js.map","// This enum should be keep in sync with their native equivalents with the same name\nexport var RewardAdPluginEvents;\n(function (RewardAdPluginEvents) {\n /**\n * Emits after trying to prepare a RewardAd and the Video is loaded and ready to be show\n */\n RewardAdPluginEvents[\"Loaded\"] = \"onRewardedVideoAdLoaded\";\n /**\n * Emits after trying to prepare a RewardAd when it could not be loaded\n */\n RewardAdPluginEvents[\"FailedToLoad\"] = \"onRewardedVideoAdFailedToLoad\";\n /**\n * Emits when the AdReward video is visible to the user\n */\n RewardAdPluginEvents[\"Showed\"] = \"onRewardedVideoAdShowed\";\n /**\n * Emits when the AdReward video is failed to show\n */\n RewardAdPluginEvents[\"FailedToShow\"] = \"onRewardedVideoAdFailedToShow\";\n /**\n * Emits when the AdReward video is not visible to the user anymore.\n *\n * **Important**: This has nothing to do with the reward it self. This event\n * will emits in this two cases:\n * 1. The user starts the video ad but close it before the reward emit.\n * 2. The user start the video and see it until end, then gets the reward\n * and after that the ad is closed.\n */\n RewardAdPluginEvents[\"Dismissed\"] = \"onRewardedVideoAdDismissed\";\n /**\n * Emits when user get rewarded from AdReward\n */\n RewardAdPluginEvents[\"Rewarded\"] = \"onRewardedVideoAdReward\";\n})(RewardAdPluginEvents || (RewardAdPluginEvents = {}));\n//# sourceMappingURL=reward-ad-plugin-events.enum.js.map","/**\n * For more information:\n * https://developers.google.com/admob/unity/reference/namespace/google-mobile-ads/ump/api#consentstatus\n *\n * */\nexport var AdmobConsentStatus;\n(function (AdmobConsentStatus) {\n /**\n * User consent not required.\n */\n AdmobConsentStatus[\"NOT_REQUIRED\"] = \"NOT_REQUIRED\";\n /**\n * User consent already obtained.\n */\n AdmobConsentStatus[\"OBTAINED\"] = \"OBTAINED\";\n /**\n * User consent required but not yet obtained.\n */\n AdmobConsentStatus[\"REQUIRED\"] = \"REQUIRED\";\n /**\n * Unknown consent status, AdsConsent.requestInfoUpdate needs to be called to update it.\n */\n AdmobConsentStatus[\"UNKNOWN\"] = \"UNKNOWN\";\n})(AdmobConsentStatus || (AdmobConsentStatus = {}));\n//# sourceMappingURL=consent-status.enum.js.map","/**\n * For more information:\n * https://developers.google.com/admob/unity/reference/namespace/google-mobile-ads/ump/api#debuggeography\n *\n * */\nexport var AdmobConsentDebugGeography;\n(function (AdmobConsentDebugGeography) {\n /**\n * Debug geography disabled.\n */\n AdmobConsentDebugGeography[AdmobConsentDebugGeography[\"DISABLED\"] = 0] = \"DISABLED\";\n /**\n * Geography appears as in EEA for debug devices.\n */\n AdmobConsentDebugGeography[AdmobConsentDebugGeography[\"EEA\"] = 1] = \"EEA\";\n /**\n * Geography appears as not in EEA for debug devices.\n */\n AdmobConsentDebugGeography[AdmobConsentDebugGeography[\"NOT_EEA\"] = 2] = \"NOT_EEA\";\n})(AdmobConsentDebugGeography || (AdmobConsentDebugGeography = {}));\n//# sourceMappingURL=consent-debug-geography.enum.js.map","import { registerPlugin } from '@capacitor/core';\nconst AdMob = registerPlugin('AdMob', {\n web: () => import('./web').then(m => new m.AdMobWeb()),\n});\nexport * from './definitions';\nexport * from './banner/index';\nexport * from './interstitial/index';\nexport * from './reward/index';\nexport * from './consent/index';\nexport * from './shared/index';\nexport { AdMob };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { AdmobConsentStatus } from './consent/consent-status.enum';\nexport class AdMobWeb extends WebPlugin {\n constructor() {\n super({\n name: 'AdMob',\n platforms: ['web'],\n });\n }\n async initialize() {\n console.log('initialize');\n }\n async targetSettings() {\n console.log('targetSettings');\n }\n async requestTrackingAuthorization() {\n console.log('requestTrackingAuthorization');\n }\n async trackingAuthorizationStatus() {\n return {\n status: 'authorized',\n };\n }\n async requestConsentInfo(options) {\n console.log('requestConsentInfo', options);\n return {\n status: AdmobConsentStatus.REQUIRED,\n isConsentFormAvailable: true,\n };\n }\n async showConsentForm() {\n console.log('showConsentForm');\n return {\n status: AdmobConsentStatus.REQUIRED,\n };\n }\n async resetConsentInfo() {\n console.log('resetConsentInfo');\n }\n async setApplicationMuted(options) {\n console.log('setApplicationMuted', options);\n }\n async setApplicationVolume(options) {\n console.log('setApplicationVolume', options);\n }\n async showBanner(options) {\n console.log('showBanner', options);\n }\n // Hide the banner, remove it from screen, but can show it later\n async hideBanner() {\n console.log('hideBanner');\n }\n // Resume the banner, show it after hide\n async resumeBanner() {\n console.log('resumeBanner');\n }\n // Destroy the banner, remove it from screen.\n async removeBanner() {\n console.log('removeBanner');\n }\n async prepareInterstitial(options) {\n console.log('prepareInterstitial', options);\n return {\n adUnitId: options.adId,\n };\n }\n async showInterstitial() {\n console.log('showInterstitial');\n }\n async prepareRewardVideoAd(options) {\n console.log(options);\n return {\n adUnitId: options.adId,\n };\n }\n async showRewardVideoAd() {\n return {\n type: '',\n amount: 0,\n };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["MaxAdContentRating","BannerAdPluginEvents","BannerAdPosition","BannerAdSize","InterstitialAdPluginEvents","RewardAdPluginEvents","AdmobConsentStatus","AdmobConsentDebugGeography","registerPlugin","WebPlugin"],"mappings":";;;AAAWA,wCAAmB;IAC9B,CAAC,UAAU,kBAAkB,EAAE;IAC/B;IACA;IACA;IACA,IAAI,kBAAkB,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;IAC9C;IACA;IACA;IACA,IAAI,kBAAkB,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAC;IAChE;IACA;IACA;IACA,IAAI,kBAAkB,CAAC,MAAM,CAAC,GAAG,MAAM,C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iB,GAAG;IAC9B,QAAQ,OAAO;IACf,YAAY,IAAI,EAAE,EAAE;IACpB,YAAY,MAAM,EAAE,CAAC;IACrB,SAAS,CAAC;IACV,KAAK;IACL;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,8 @@
1
+ public enum BannerAdPluginEvents: String {
2
+ case SizeChanged = "bannerAdSizeChanged"
3
+ case Closed = "bannerAdClosed"
4
+ case FailedToLoad = "bannerAdFailedToLoad"
5
+ case Opened = "bannerAdOpened"
6
+ case Loaded = "bannerAdLoaded"
7
+ case AdImpression = "bannerAdImpression"
8
+ }
@@ -0,0 +1,10 @@
1
+ public enum BannerAdSizeEnum: String {
2
+ case BANNER = "BANNER"
3
+ case FULL_BANNER = "FULL_BANNER"
4
+ case LARGE_BANNER = "LARGE_BANNER"
5
+ case LEADERBOARD = "LEADERBOARD"
6
+ case MEDIUM_RECTANGLE = "MEDIUM_RECTANGLE"
7
+ case WIDE_SKYSCRAPER = "WIDE_SKYSCRAPER"
8
+ case ADAPTIVE_BANNER = "ADAPTIVE_BANNER"
9
+ // case FLUID = "FLUID"
10
+ }
@@ -0,0 +1,198 @@
1
+ import Foundation
2
+ import Capacitor
3
+ import GoogleMobileAds
4
+
5
+ class BannerExecutor: NSObject, GADBannerViewDelegate {
6
+ public weak var plugin: AdMob?
7
+ var bannerView: GADBannerView!
8
+
9
+ func showBanner(_ call: CAPPluginCall, _ request: GADRequest, _ adUnitID: String) {
10
+ if let rootViewController = plugin?.getRootVC() {
11
+
12
+ let adSize = call.getString("adSize") ?? "ADAPTIVE_BANNER"
13
+ let adPosition = call.getString("position") ?? "BOTTOM_CENTER"
14
+ let adMargin = call.getInt("margin") ?? 0
15
+
16
+ var bannerSize: GADAdSize
17
+
18
+ switch adSize {
19
+ case "BANNER":
20
+ bannerSize = GADAdSizeBanner
21
+ break
22
+ case "LARGE_BANNER":
23
+ bannerSize = GADAdSizeLargeBanner
24
+ break
25
+ case "FULL_BANNER":
26
+ bannerSize = GADAdSizeFullBanner
27
+ break
28
+ case "LEADERBOARD":
29
+ bannerSize = GADAdSizeLeaderboard
30
+ break
31
+ case "MEDIUM_RECTANGLE":
32
+ bannerSize = GADAdSizeMediumRectangle
33
+ break
34
+ case "SMART_BANNER":
35
+ bannerSize = kGADAdSizeSmartBannerPortrait
36
+ break
37
+ default: // ADAPTIVE_BANNER
38
+ let frame = { () -> CGRect in
39
+ // Here safe area is taken into account, hence the view frame is used
40
+ // after the view has been laid out.
41
+ if #available(iOS 11.0, *) {
42
+ return rootViewController.view.frame.inset(by: rootViewController.view.safeAreaInsets)
43
+ } else {
44
+ return rootViewController.view.frame
45
+ }
46
+ }()
47
+ let viewWidth = frame.size.width
48
+ bannerSize = GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(viewWidth)
49
+ break
50
+ }
51
+
52
+ self.bannerView = GADBannerView(adSize: bannerSize)
53
+ self.addBannerViewToView(self.bannerView, adPosition, adMargin)
54
+ self.bannerView.translatesAutoresizingMaskIntoConstraints = false
55
+ self.bannerView.adUnitID = adUnitID
56
+ self.bannerView.rootViewController = plugin?.getRootVC()
57
+
58
+ self.bannerView.load(request)
59
+ self.bannerView.delegate = self
60
+
61
+ call.resolve([:])
62
+ }
63
+ }
64
+
65
+ func hideBanner(_ call: CAPPluginCall) {
66
+ DispatchQueue.main.async {
67
+ if let rootViewController = self.plugin?.getRootVC() {
68
+ if let subView = rootViewController.view.viewWithTag(2743243288699) {
69
+ NSLog("AdMob: find subView for hideBanner")
70
+ subView.isHidden = true
71
+ } else {
72
+ NSLog("AdMob: not find subView for resumeBanner for hideBanner")
73
+ }
74
+ }
75
+
76
+ self.plugin?.notifyListeners(BannerAdPluginEvents.SizeChanged.rawValue, data: [
77
+ "width": 0,
78
+ "height": 0
79
+ ])
80
+
81
+ call.resolve([:])
82
+ }
83
+ }
84
+
85
+ func resumeBanner(_ call: CAPPluginCall) {
86
+ if let rootViewController = plugin?.getRootVC() {
87
+ if let subView = rootViewController.view.viewWithTag(2743243288699) {
88
+ NSLog("AdMob: find subView for resumeBanner")
89
+ subView.isHidden = false
90
+
91
+ let width = subView.frame.width
92
+ var height = subView.frame.height
93
+ // For fixing issue 160 iOs banner overlapping content on iPhone with rounded corners
94
+ let safeAreaBottom = UIApplication.shared.keyWindow?.safeAreaInsets.bottom ?? 0
95
+ height += safeAreaBottom
96
+
97
+ self.plugin?.notifyListeners(BannerAdPluginEvents.SizeChanged.rawValue, data: [
98
+ "width": width,
99
+ "height": height
100
+ ])
101
+
102
+ call.resolve([:])
103
+
104
+ } else {
105
+ NSLog("AdMob: not find subView for resumeBanner")
106
+ call.reject("AdMob: not find subView for resumeBanner")
107
+ }
108
+ }
109
+ }
110
+
111
+ func removeBanner(_ call: CAPPluginCall) {
112
+ self.removeBannerViewToView()
113
+ call.resolve([:])
114
+ }
115
+
116
+ private func addBannerViewToView(_ bannerView: GADBannerView, _ adPosition: String, _ Margin: Int) {
117
+ removeBannerViewToView()
118
+ if let rootViewController = plugin?.getRootVC() {
119
+
120
+ bannerView.translatesAutoresizingMaskIntoConstraints = false
121
+ bannerView.tag = 2743243288699 // rand
122
+ rootViewController.view.addSubview(bannerView)
123
+ rootViewController.view.addConstraints(
124
+ [NSLayoutConstraint(item: bannerView,
125
+ attribute: adPosition == "TOP_CENTER" ? .top : .bottom,
126
+ relatedBy: .equal,
127
+ toItem: rootViewController.view.safeAreaLayoutGuide,
128
+ attribute: adPosition == "TOP_CENTER" ? .top : .bottom,
129
+ multiplier: 1,
130
+ constant: CGFloat(Int(Margin) * -1)),
131
+ NSLayoutConstraint(item: bannerView,
132
+ attribute: .centerX,
133
+ relatedBy: .equal,
134
+ toItem: rootViewController.view,
135
+ attribute: .centerX,
136
+ multiplier: 1,
137
+ constant: 0)
138
+ ])
139
+ }
140
+ }
141
+
142
+ private func removeBannerViewToView() {
143
+ if let rootViewController = plugin?.getRootVC() {
144
+ if let subView = rootViewController.view.viewWithTag(2743243288699) {
145
+ bannerView.delegate = nil
146
+ NSLog("AdMob: find subView")
147
+ subView.removeFromSuperview()
148
+ }
149
+ }
150
+ }
151
+
152
+ /// Tells the delegate an ad request loaded an ad.
153
+ public func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
154
+ NSLog("bannerViewDidReceiveAd")
155
+
156
+ let width = bannerView.frame.width
157
+ var height = bannerView.frame.height
158
+ // For fixing issue 160 iOs banner overlapping content on iPhone with rounded corners
159
+ let safeAreaBottom = UIApplication.shared.keyWindow?.safeAreaInsets.bottom ?? 0
160
+ height += safeAreaBottom
161
+
162
+ self.plugin?.notifyListeners(BannerAdPluginEvents.SizeChanged.rawValue, data: [
163
+ "width": width,
164
+ "height": height
165
+ ])
166
+ self.plugin?.notifyListeners(BannerAdPluginEvents.Loaded.rawValue, data: [:])
167
+ }
168
+
169
+ /// Tells the delegate an ad request failed.
170
+ public func bannerView(_ bannerView: GADBannerView,
171
+ didFailToReceiveAdWithError error: Error) {
172
+ NSLog("bannerView:didFailToReceiveAdWithError: \(error.localizedDescription)")
173
+ self.removeBannerViewToView()
174
+ self.plugin?.notifyListeners(BannerAdPluginEvents.SizeChanged.rawValue, data: [
175
+ "width": 0,
176
+ "height": 0
177
+ ])
178
+ self.plugin?.notifyListeners(BannerAdPluginEvents.FailedToLoad.rawValue, data: [
179
+ "code": 0,
180
+ "message": error.localizedDescription
181
+ ])
182
+ }
183
+
184
+ public func bannerViewDidRecordImpression(_ bannerView: GADBannerView) {
185
+ self.plugin?.notifyListeners(BannerAdPluginEvents.AdImpression.rawValue, data: [:])
186
+ }
187
+
188
+ /// Tells the delegate that a full-screen view will be presented in response
189
+ /// to the user clicking on an ad.
190
+ public func bannerViewWillPresentScreen(_ bannerView: GADBannerView) {
191
+ self.plugin?.notifyListeners(BannerAdPluginEvents.Opened.rawValue, data: [:])
192
+ }
193
+
194
+ /// Tells the delegate that the full-screen view will be dismissed.
195
+ public func bannerViewWillDismissScreen(_ bannerView: GADBannerView) {
196
+ self.plugin?.notifyListeners(BannerAdPluginEvents.Closed.rawValue, data: [:])
197
+ }
198
+ }