@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/README.md ADDED
@@ -0,0 +1,1091 @@
1
+ <p align="center"><br><img src="https://user-images.githubusercontent.com/236501/85893648-1c92e880-b7a8-11ea-926d-95355b8175c7.png" width="128" height="128" /></p>
2
+ <h3 align="center">AdMob</h3>
3
+ <p align="center"><strong><code>@capacitor-community/admob</code></strong></p>
4
+ <p align="center">
5
+ Capacitor community plugin for native AdMob.
6
+ </p>
7
+
8
+ <p align="center">
9
+ <img src="https://img.shields.io/maintenance/yes/2023?style=flat-square" />
10
+ <!-- <a href="https://github.com/capacitor-community/example/actions?query=workflow%3A%22CI%22"><img src="https://img.shields.io/github/workflow/status/capacitor-community/example/CI?style=flat-square" /></a> -->
11
+ <a href="https://www.npmjs.com/package/@capacitor-community/admob"><img src="https://img.shields.io/npm/l/@capacitor-community/admob?style=flat-square" /></a>
12
+ <br>
13
+ <a href="https://www.npmjs.com/package/@capacitor-community/admob"><img src="https://img.shields.io/npm/dw/@capacitor-community/admob?style=flat-square" /></a>
14
+ <a href="https://www.npmjs.com/package/@capacitor-community/admob"><img src="https://img.shields.io/npm/v/@capacitor-community/admob?style=flat-square" /></a>
15
+ </p>
16
+
17
+ ## Maintainers
18
+
19
+ | Maintainer | GitHub | Social | Sponsoring Company |
20
+ | ------------------- | ----------------------------------- | ------------------------------------- | ---------------------------------------------- |
21
+ | Masahiko Sakakibara | [rdlabo](https://github.com/rdlabo) | [@rdlabo](https://twitter.com/rdlabo) | RELATION DESIGN LABO, GENERAL INC. ASSOCIATION |
22
+ | Saninn Salas Diaz | [Saninn Salas Diaz](https://github.com/distante) | [@SaninnSalas](https://twitter.com/SaninnSalas) | |
23
+
24
+ Maintenance Status: Actively Maintained
25
+
26
+ ## Contributors ✨
27
+ <a href="https://github.com/capacitor-community/admob/graphs/contributors">
28
+ <img src="https://contrib.rocks/image?repo=capacitor-community/admob" />
29
+ </a>
30
+
31
+ Made with [contributors-img](https://contrib.rocks).
32
+
33
+ ## Demo
34
+
35
+ [Demo code is here.](https://github.com/capacitor-community/admob/tree/master/demo)
36
+
37
+ ### Screenshots
38
+
39
+ | | Banner | Interstitial | Reward |
40
+ | :---------- | :----------------------------------: | :----------------------------------------: | :----------------------------------: |
41
+ | **iOS** | ![](demo/screenshots/ios_banner.png) | ![](demo/screenshots/ios_interstitial.png) | ![](demo/screenshots/ios_reward.png) |
42
+ | **Android** | ![](demo/screenshots/md_banner.png) | ![](demo/screenshots/md_interstitial.png) | ![](demo/screenshots/md_reward.png) |
43
+
44
+ ## Installation
45
+ If you use capacitor 5:
46
+
47
+ ```
48
+ % npm install --save @capacitor-community/admob@5.0.0
49
+ % npx cap update
50
+ ```
51
+
52
+ If you use capacitor 4:
53
+
54
+ ```
55
+ % npm install --save @capacitor-community/admob@4.0.0
56
+ % npx cap update
57
+ ```
58
+
59
+ capacitor 3:
60
+
61
+ ```
62
+ % npm install --save @capacitor-community/admob@3.3.0
63
+ % npx cap update
64
+ ```
65
+
66
+ ### Android configuration
67
+
68
+ In file `android/app/src/main/AndroidManifest.xml`, add the following XML elements under `<manifest><application>` :
69
+
70
+ ```xml
71
+ <meta-data
72
+ android:name="com.google.android.gms.ads.APPLICATION_ID"
73
+ android:value="@string/admob_app_id"/>
74
+ ```
75
+
76
+ In file `android/app/src/main/res/values/strings.xml` add the following lines :
77
+
78
+ ```xml
79
+ <string name="admob_app_id">[APP_ID]</string>
80
+ ```
81
+
82
+ Don't forget to replace `[APP_ID]` by your AdMob application Id.
83
+
84
+ #### Variables
85
+
86
+ This plugin will use the following project variables (defined in your app's `variables.gradle` file):
87
+
88
+ - `playServicesAdsVersion` version of `com.google.android.gms:play-services-ads` (default: `22.0.0`)
89
+ - `androidxCoreKTXVersion`: version of `androidx.core:core-ktx` (default: `1.10.0`)
90
+
91
+ ### iOS configuration
92
+
93
+ Add the following in the `ios/App/App/info.plist` file inside of the outermost `<dict>`:
94
+
95
+ ```xml
96
+ <key>GADIsAdManagerApp</key>
97
+ <true/>
98
+ <key>GADApplicationIdentifier</key>
99
+ <string>[APP_ID]</string>
100
+ <key>SKAdNetworkItems</key>
101
+ <array>
102
+ <dict>
103
+ <key>SKAdNetworkIdentifier</key>
104
+ <string>cstr6suwn9.skadnetwork</string>
105
+ </dict>
106
+ </array>
107
+ <key>NSUserTrackingUsageDescription</key>
108
+ <string>[Why you use NSUserTracking. ex: This identifier will be used to deliver personalized ads to you.]</string>
109
+ ```
110
+
111
+ Don't forget to replace `[APP_ID]` by your AdMob application Id.
112
+
113
+ ## Example
114
+
115
+ ### Initialize AdMob
116
+
117
+ ```ts
118
+ import { AdMob } from '@capacitor-community/admob';
119
+
120
+ export async function initialize(): Promise<void> {
121
+ await AdMob.initialize();
122
+
123
+ const [trackingInfo, consentInfo] = await Promise.all([
124
+ AdMob.trackingAuthorizationStatus(),
125
+ AdMob.requestConsentInfo(),
126
+ ]);
127
+
128
+ if (trackingInfo.status === 'notDetermined') {
129
+ /**
130
+ * If you want to explain TrackingAuthorization before showing the iOS dialog,
131
+ * you can show the modal here.
132
+ * ex)
133
+ * const modal = await this.modalCtrl.create({
134
+ * component: RequestTrackingPage,
135
+ * });
136
+ * await modal.present();
137
+ * await modal.onDidDismiss(); // Wait for close modal
138
+ **/
139
+
140
+ await AdMob.requestTrackingAuthorization();
141
+ }
142
+
143
+ const authorizationStatus = await AdMob.trackingAuthorizationStatus();
144
+ if (
145
+ authorizationStatus.status === 'authorized' &&
146
+ consentInfo.isConsentFormAvailable &&
147
+ consentInfo.status === AdmobConsentStatus.REQUIRED
148
+ ) {
149
+ await AdMob.showConsentForm();
150
+ }
151
+ }
152
+ ```
153
+
154
+ Send and array of device Ids in `testingDevices? to use production like ads on your specified devices -> https://developers.google.com/admob/android/test-ads#enable_test_devices
155
+
156
+ ### User Message Platform (UMP)
157
+
158
+ Later this year, Google will require all publishers serving ads to EEA and UK users to use a Google-certified Consent Management Platform (CMP)
159
+
160
+ Currently we just support Google's consent management solution.
161
+
162
+ To use UMP, you must [create your GDPR messages](https://support.google.com/admob/answer/10113207?hl=en&ref_topic=10105230&sjid=6731900490614517032-AP)
163
+
164
+ You may need to [setup IDFA messages](https://support.google.com/admob/answer/10115027?hl=en), it will work along with GDPR messages and will show when users are not in EEA and UK.
165
+
166
+ Example of how to use UMP
167
+
168
+ ```ts
169
+ import { AdMob, AdmobConsentStatus, AdmobConsentDebugGeography } from '@capacitor-community/admob';
170
+
171
+ async showConsent() {
172
+ const consentInfo = await AdMob.requestConsentInfo();
173
+
174
+ if (consentInfo.isConsentFormAvailable && consentInfo.status === AdmobConsentStatus.REQUIRED) {
175
+ const {status} = await AdMob.showConsentForm();
176
+ }
177
+ }
178
+ ```
179
+
180
+ If you testing on real device, you have to set `debugGeography` and add your device ID to `testDeviceIdentifiers`. You can find your device ID with logcat (Android) or XCode (iOS).
181
+
182
+ ```ts
183
+ const consentInfo = await AdMob.requestConsentInfo({
184
+ debugGeography: AdmobConsentDebugGeography.EEA,
185
+ testDeviceIdentifiers: ['YOUR_DEVICE_ID']
186
+ });
187
+ ```
188
+
189
+ **Note**: When testing, if you choose not consent (Manage -> Confirm Choices). The ads may not load/show. Even on testing enviroment. This is normal. It will work on Production so don't worry.
190
+
191
+ **Note**: The order in which they are combined with other methods is as follows.
192
+
193
+ 1. AdMob.initialize
194
+ 2. AdMob.requestConsentInfo
195
+ 3. AdMob.showConsentForm (If consent form required )
196
+ 3/ AdMob.showBanner
197
+
198
+ ### Show Banner
199
+
200
+ ```ts
201
+ import { AdMob, BannerAdOptions, BannerAdSize, BannerAdPosition, BannerAdPluginEvents, AdMobBannerSize } from '@capacitor-community/admob';
202
+
203
+ export async function banner(): Promise<void> {
204
+ AdMob.addListener(BannerAdPluginEvents.Loaded, () => {
205
+ // Subscribe Banner Event Listener
206
+ });
207
+
208
+ AdMob.addListener(BannerAdPluginEvents.SizeChanged, (size: AdMobBannerSize) => {
209
+ // Subscribe Change Banner Size
210
+ });
211
+
212
+ const options: BannerAdOptions = {
213
+ adId: 'YOUR ADID',
214
+ adSize: BannerAdSize.BANNER,
215
+ position: BannerAdPosition.BOTTOM_CENTER,
216
+ margin: 0,
217
+ // isTesting: true
218
+ // npa: true
219
+ };
220
+ AdMob.showBanner(options);
221
+ }
222
+ ```
223
+
224
+ ### Show Interstitial
225
+
226
+ ```ts
227
+ import { AdMob, AdOptions, AdLoadInfo, InterstitialAdPluginEvents } from '@capacitor-community/admob';
228
+
229
+ export async function interstitial(): Promise<void> {
230
+ AdMob.addListener(InterstitialAdPluginEvents.Loaded, (info: AdLoadInfo) => {
231
+ // Subscribe prepared interstitial
232
+ });
233
+
234
+ const options: AdOptions = {
235
+ adId: 'YOUR ADID',
236
+ // isTesting: true
237
+ // npa: true
238
+ };
239
+ await AdMob.prepareInterstitial(options);
240
+ await AdMob.showInterstitial();
241
+ }
242
+ ```
243
+
244
+ ### Show RewardVideo
245
+
246
+ ```ts
247
+ import { AdMob, RewardAdOptions, AdLoadInfo, RewardAdPluginEvents, AdMobRewardItem } from '@capacitor-community/admob';
248
+
249
+ export async function rewardVideo(): Promise<void> {
250
+ AdMob.addListener(RewardAdPluginEvents.Loaded, (info: AdLoadInfo) => {
251
+ // Subscribe prepared rewardVideo
252
+ });
253
+
254
+ AdMob.addListener(RewardAdPluginEvents.Rewarded, (rewardItem: AdMobRewardItem) => {
255
+ // Subscribe user rewarded
256
+ console.log(rewardItem);
257
+ });
258
+
259
+ const options: RewardAdOptions = {
260
+ adId: 'YOUR ADID',
261
+ // isTesting: true
262
+ // npa: true
263
+ // ssv: {
264
+ // userId: "A user ID to send to your SSV"
265
+ // customData: JSON.stringify({ ...MyCustomData })
266
+ //}
267
+ };
268
+ await AdMob.prepareRewardVideoAd(options);
269
+ const rewardItem = await AdMob.showRewardVideoAd();
270
+ }
271
+ ```
272
+
273
+ ## Server-side Verification Notice
274
+ SSV callbacks are only fired on Production Adverts, therefore test Ads will not fire off your SSV callback.
275
+
276
+ For E2E tests or just for validating the data in your `RewardAdOptions` work as expected, you can add a custom GET
277
+ request to your mock endpoint after the `RewardAdPluginEvents.Rewarded` similar to this:
278
+ ```ts
279
+ AdMob.addListener(RewardAdPluginEvents.Rewarded, async () => {
280
+ // ...
281
+ if (ENVIRONMENT_IS_DEVELOPMENT) {
282
+ try {
283
+ const url = `https://your-staging-ssv-endpoint` + new URLSearchParams({
284
+ 'ad_network': 'TEST',
285
+ 'ad_unit': 'TEST',
286
+ 'custom_data': customData, // <-- passed CustomData
287
+ 'reward_amount': 'TEST',
288
+ 'reward_item': 'TEST',
289
+ 'timestamp': 'TEST',
290
+ 'transaction_id': 'TEST',
291
+ 'user_id': userId, // <-- Passed UserID
292
+ 'signature': 'TEST',
293
+ 'key_id': 'TEST'
294
+ });
295
+ await fetch(url);
296
+ } catch (err) {
297
+ console.error(err);
298
+ }
299
+ }
300
+ // ...
301
+ });
302
+ ```
303
+
304
+
305
+ ## Index
306
+ <docgen-index>
307
+
308
+ * [`initialize(...)`](#initialize)
309
+ * [`trackingAuthorizationStatus()`](#trackingauthorizationstatus)
310
+ * [`requestTrackingAuthorization()`](#requesttrackingauthorization)
311
+ * [`setApplicationMuted(...)`](#setapplicationmuted)
312
+ * [`setApplicationVolume(...)`](#setapplicationvolume)
313
+ * [`showBanner(...)`](#showbanner)
314
+ * [`hideBanner()`](#hidebanner)
315
+ * [`resumeBanner()`](#resumebanner)
316
+ * [`removeBanner()`](#removebanner)
317
+ * [`addListener(BannerAdPluginEvents.SizeChanged, ...)`](#addlistenerbanneradplugineventssizechanged-)
318
+ * [`addListener(BannerAdPluginEvents.Loaded, ...)`](#addlistenerbanneradplugineventsloaded-)
319
+ * [`addListener(BannerAdPluginEvents.FailedToLoad, ...)`](#addlistenerbanneradplugineventsfailedtoload-)
320
+ * [`addListener(BannerAdPluginEvents.Opened, ...)`](#addlistenerbanneradplugineventsopened-)
321
+ * [`addListener(BannerAdPluginEvents.Closed, ...)`](#addlistenerbanneradplugineventsclosed-)
322
+ * [`addListener(BannerAdPluginEvents.AdImpression, ...)`](#addlistenerbanneradplugineventsadimpression-)
323
+ * [`requestConsentInfo(...)`](#requestconsentinfo)
324
+ * [`showConsentForm()`](#showconsentform)
325
+ * [`resetConsentInfo()`](#resetconsentinfo)
326
+ * [`prepareInterstitial(...)`](#prepareinterstitial)
327
+ * [`showInterstitial()`](#showinterstitial)
328
+ * [`addListener(InterstitialAdPluginEvents.FailedToLoad, ...)`](#addlistenerinterstitialadplugineventsfailedtoload-)
329
+ * [`addListener(InterstitialAdPluginEvents.Loaded, ...)`](#addlistenerinterstitialadplugineventsloaded-)
330
+ * [`addListener(InterstitialAdPluginEvents.Dismissed, ...)`](#addlistenerinterstitialadplugineventsdismissed-)
331
+ * [`addListener(InterstitialAdPluginEvents.FailedToShow, ...)`](#addlistenerinterstitialadplugineventsfailedtoshow-)
332
+ * [`addListener(InterstitialAdPluginEvents.Showed, ...)`](#addlistenerinterstitialadplugineventsshowed-)
333
+ * [`prepareRewardVideoAd(...)`](#preparerewardvideoad)
334
+ * [`showRewardVideoAd()`](#showrewardvideoad)
335
+ * [`addListener(RewardAdPluginEvents.FailedToLoad, ...)`](#addlistenerrewardadplugineventsfailedtoload-)
336
+ * [`addListener(RewardAdPluginEvents.Loaded, ...)`](#addlistenerrewardadplugineventsloaded-)
337
+ * [`addListener(RewardAdPluginEvents.Rewarded, ...)`](#addlistenerrewardadplugineventsrewarded-)
338
+ * [`addListener(RewardAdPluginEvents.Dismissed, ...)`](#addlistenerrewardadplugineventsdismissed-)
339
+ * [`addListener(RewardAdPluginEvents.FailedToShow, ...)`](#addlistenerrewardadplugineventsfailedtoshow-)
340
+ * [`addListener(RewardAdPluginEvents.Showed, ...)`](#addlistenerrewardadplugineventsshowed-)
341
+ * [Interfaces](#interfaces)
342
+ * [Type Aliases](#type-aliases)
343
+ * [Enums](#enums)
344
+
345
+ </docgen-index>
346
+
347
+ ## API
348
+ <docgen-api>
349
+ <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
350
+
351
+ ### initialize(...)
352
+
353
+ ```typescript
354
+ initialize(options?: AdMobInitializationOptions) => Promise<void>
355
+ ```
356
+
357
+ Initialize AdMob with <a href="#admobinitializationoptions">AdMobInitializationOptions</a>
358
+
359
+ | Param | Type | Description |
360
+ | ------------- | --------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
361
+ | **`options`** | <code><a href="#admobinitializationoptions">AdMobInitializationOptions</a></code> | <a href="#admobinitializationoptions">AdMobInitializationOptions</a> |
362
+
363
+ --------------------
364
+
365
+
366
+ ### trackingAuthorizationStatus()
367
+
368
+ ```typescript
369
+ trackingAuthorizationStatus() => Promise<TrackingAuthorizationStatusInterface>
370
+ ```
371
+
372
+ Confirm requestTrackingAuthorization status (iOS &gt;14)
373
+
374
+ **Returns:** <code>Promise&lt;<a href="#trackingauthorizationstatusinterface">TrackingAuthorizationStatusInterface</a>&gt;</code>
375
+
376
+ --------------------
377
+
378
+
379
+ ### requestTrackingAuthorization()
380
+
381
+ ```typescript
382
+ requestTrackingAuthorization() => Promise<void>
383
+ ```
384
+
385
+ request requestTrackingAuthorization (iOS &gt;14).
386
+ This is deprecated method. We recommend UMP Consent.
387
+
388
+ --------------------
389
+
390
+
391
+ ### setApplicationMuted(...)
392
+
393
+ ```typescript
394
+ setApplicationMuted(options: ApplicationMutedOptions) => Promise<void>
395
+ ```
396
+
397
+ Report application mute state to AdMob SDK
398
+
399
+ | Param | Type |
400
+ | ------------- | --------------------------------------------------------------------------- |
401
+ | **`options`** | <code><a href="#applicationmutedoptions">ApplicationMutedOptions</a></code> |
402
+
403
+ --------------------
404
+
405
+
406
+ ### setApplicationVolume(...)
407
+
408
+ ```typescript
409
+ setApplicationVolume(options: ApplicationVolumeOptions) => Promise<void>
410
+ ```
411
+
412
+ Report application volume to AdMob SDK
413
+
414
+ | Param | Type |
415
+ | ------------- | ----------------------------------------------------------------------------- |
416
+ | **`options`** | <code><a href="#applicationvolumeoptions">ApplicationVolumeOptions</a></code> |
417
+
418
+ --------------------
419
+
420
+
421
+ ### showBanner(...)
422
+
423
+ ```typescript
424
+ showBanner(options: BannerAdOptions) => Promise<void>
425
+ ```
426
+
427
+ Show a banner Ad
428
+
429
+ | Param | Type | Description |
430
+ | ------------- | ----------------------------------------------------------- | ---------------------------------- |
431
+ | **`options`** | <code><a href="#banneradoptions">BannerAdOptions</a></code> | <a href="#adoptions">AdOptions</a> |
432
+
433
+ --------------------
434
+
435
+
436
+ ### hideBanner()
437
+
438
+ ```typescript
439
+ hideBanner() => Promise<void>
440
+ ```
441
+
442
+ Hide the banner, remove it from screen, but can show it later
443
+
444
+ --------------------
445
+
446
+
447
+ ### resumeBanner()
448
+
449
+ ```typescript
450
+ resumeBanner() => Promise<void>
451
+ ```
452
+
453
+ Resume the banner, show it after hide
454
+
455
+ --------------------
456
+
457
+
458
+ ### removeBanner()
459
+
460
+ ```typescript
461
+ removeBanner() => Promise<void>
462
+ ```
463
+
464
+ Destroy the banner, remove it from screen.
465
+
466
+ --------------------
467
+
468
+
469
+ ### addListener(BannerAdPluginEvents.SizeChanged, ...)
470
+
471
+ ```typescript
472
+ addListener(eventName: BannerAdPluginEvents.SizeChanged, listenerFunc: (info: AdMobBannerSize) => void) => PluginListenerHandle
473
+ ```
474
+
475
+ | Param | Type | Description |
476
+ | ------------------ | --------------------------------------------------------------------------------- | ------------------- |
477
+ | **`eventName`** | <code><a href="#banneradpluginevents">BannerAdPluginEvents.SizeChanged</a></code> | bannerAdSizeChanged |
478
+ | **`listenerFunc`** | <code>(info: <a href="#admobbannersize">AdMobBannerSize</a>) =&gt; void</code> | |
479
+
480
+ **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
481
+
482
+ --------------------
483
+
484
+
485
+ ### addListener(BannerAdPluginEvents.Loaded, ...)
486
+
487
+ ```typescript
488
+ addListener(eventName: BannerAdPluginEvents.Loaded, listenerFunc: () => void) => PluginListenerHandle
489
+ ```
490
+
491
+ Notice: request loaded Banner ad
492
+
493
+ | Param | Type | Description |
494
+ | ------------------ | ---------------------------------------------------------------------------- | -------------- |
495
+ | **`eventName`** | <code><a href="#banneradpluginevents">BannerAdPluginEvents.Loaded</a></code> | bannerAdLoaded |
496
+ | **`listenerFunc`** | <code>() =&gt; void</code> | |
497
+
498
+ **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
499
+
500
+ --------------------
501
+
502
+
503
+ ### addListener(BannerAdPluginEvents.FailedToLoad, ...)
504
+
505
+ ```typescript
506
+ addListener(eventName: BannerAdPluginEvents.FailedToLoad, listenerFunc: (info: AdMobError) => void) => PluginListenerHandle
507
+ ```
508
+
509
+ Notice: request failed Banner ad
510
+
511
+ | Param | Type | Description |
512
+ | ------------------ | ---------------------------------------------------------------------------------- | -------------------- |
513
+ | **`eventName`** | <code><a href="#banneradpluginevents">BannerAdPluginEvents.FailedToLoad</a></code> | bannerAdFailedToLoad |
514
+ | **`listenerFunc`** | <code>(info: <a href="#admoberror">AdMobError</a>) =&gt; void</code> | |
515
+
516
+ **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
517
+
518
+ --------------------
519
+
520
+
521
+ ### addListener(BannerAdPluginEvents.Opened, ...)
522
+
523
+ ```typescript
524
+ addListener(eventName: BannerAdPluginEvents.Opened, listenerFunc: () => void) => PluginListenerHandle
525
+ ```
526
+
527
+ Notice: full-screen banner view will be presented in response to the user clicking on an ad.
528
+
529
+ | Param | Type | Description |
530
+ | ------------------ | ---------------------------------------------------------------------------- | -------------- |
531
+ | **`eventName`** | <code><a href="#banneradpluginevents">BannerAdPluginEvents.Opened</a></code> | bannerAdOpened |
532
+ | **`listenerFunc`** | <code>() =&gt; void</code> | |
533
+
534
+ **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
535
+
536
+ --------------------
537
+
538
+
539
+ ### addListener(BannerAdPluginEvents.Closed, ...)
540
+
541
+ ```typescript
542
+ addListener(eventName: BannerAdPluginEvents.Closed, listenerFunc: () => void) => PluginListenerHandle
543
+ ```
544
+
545
+ Notice: The full-screen banner view will been dismissed.
546
+
547
+ | Param | Type | Description |
548
+ | ------------------ | ---------------------------------------------------------------------------- | -------------- |
549
+ | **`eventName`** | <code><a href="#banneradpluginevents">BannerAdPluginEvents.Closed</a></code> | bannerAdClosed |
550
+ | **`listenerFunc`** | <code>() =&gt; void</code> | |
551
+
552
+ **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
553
+
554
+ --------------------
555
+
556
+
557
+ ### addListener(BannerAdPluginEvents.AdImpression, ...)
558
+
559
+ ```typescript
560
+ addListener(eventName: BannerAdPluginEvents.AdImpression, listenerFunc: () => void) => PluginListenerHandle
561
+ ```
562
+
563
+ Unimplemented
564
+
565
+ | Param | Type | Description |
566
+ | ------------------ | ---------------------------------------------------------------------------------- | ------------ |
567
+ | **`eventName`** | <code><a href="#banneradpluginevents">BannerAdPluginEvents.AdImpression</a></code> | AdImpression |
568
+ | **`listenerFunc`** | <code>() =&gt; void</code> | |
569
+
570
+ **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
571
+
572
+ --------------------
573
+
574
+
575
+ ### requestConsentInfo(...)
576
+
577
+ ```typescript
578
+ requestConsentInfo(options?: AdmobConsentRequestOptions) => Promise<AdmobConsentInfo>
579
+ ```
580
+
581
+ Request user consent information
582
+
583
+ | Param | Type | Description |
584
+ | ------------- | --------------------------------------------------------------------------------- | --------------------- |
585
+ | **`options`** | <code><a href="#admobconsentrequestoptions">AdmobConsentRequestOptions</a></code> | ConsentRequestOptions |
586
+
587
+ **Returns:** <code>Promise&lt;<a href="#admobconsentinfo">AdmobConsentInfo</a>&gt;</code>
588
+
589
+ --------------------
590
+
591
+
592
+ ### showConsentForm()
593
+
594
+ ```typescript
595
+ showConsentForm() => Promise<AdmobConsentInfo>
596
+ ```
597
+
598
+ Shows a google user consent form (rendered from your GDPR message config).
599
+
600
+ **Returns:** <code>Promise&lt;<a href="#admobconsentinfo">AdmobConsentInfo</a>&gt;</code>
601
+
602
+ --------------------
603
+
604
+
605
+ ### resetConsentInfo()
606
+
607
+ ```typescript
608
+ resetConsentInfo() => Promise<void>
609
+ ```
610
+
611
+ Resets the UMP SDK state. Call requestConsentInfo function again to allow user modify their consent
612
+
613
+ --------------------
614
+
615
+
616
+ ### prepareInterstitial(...)
617
+
618
+ ```typescript
619
+ prepareInterstitial(options: AdOptions) => Promise<AdLoadInfo>
620
+ ```
621
+
622
+ Prepare interstitial banner
623
+
624
+ | Param | Type | Description |
625
+ | ------------- | ----------------------------------------------- | ---------------------------------- |
626
+ | **`options`** | <code><a href="#adoptions">AdOptions</a></code> | <a href="#adoptions">AdOptions</a> |
627
+
628
+ **Returns:** <code>Promise&lt;<a href="#adloadinfo">AdLoadInfo</a>&gt;</code>
629
+
630
+ --------------------
631
+
632
+
633
+ ### showInterstitial()
634
+
635
+ ```typescript
636
+ showInterstitial() => Promise<void>
637
+ ```
638
+
639
+ Show interstitial ad when it’s ready
640
+
641
+ --------------------
642
+
643
+
644
+ ### addListener(InterstitialAdPluginEvents.FailedToLoad, ...)
645
+
646
+ ```typescript
647
+ addListener(eventName: InterstitialAdPluginEvents.FailedToLoad, listenerFunc: (error: AdMobError) => void) => PluginListenerHandle
648
+ ```
649
+
650
+ | Param | Type |
651
+ | ------------------ | ---------------------------------------------------------------------------------------------- |
652
+ | **`eventName`** | <code><a href="#interstitialadpluginevents">InterstitialAdPluginEvents.FailedToLoad</a></code> |
653
+ | **`listenerFunc`** | <code>(error: <a href="#admoberror">AdMobError</a>) =&gt; void</code> |
654
+
655
+ **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
656
+
657
+ --------------------
658
+
659
+
660
+ ### addListener(InterstitialAdPluginEvents.Loaded, ...)
661
+
662
+ ```typescript
663
+ addListener(eventName: InterstitialAdPluginEvents.Loaded, listenerFunc: (info: AdLoadInfo) => void) => PluginListenerHandle
664
+ ```
665
+
666
+ | Param | Type |
667
+ | ------------------ | ---------------------------------------------------------------------------------------- |
668
+ | **`eventName`** | <code><a href="#interstitialadpluginevents">InterstitialAdPluginEvents.Loaded</a></code> |
669
+ | **`listenerFunc`** | <code>(info: <a href="#adloadinfo">AdLoadInfo</a>) =&gt; void</code> |
670
+
671
+ **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
672
+
673
+ --------------------
674
+
675
+
676
+ ### addListener(InterstitialAdPluginEvents.Dismissed, ...)
677
+
678
+ ```typescript
679
+ addListener(eventName: InterstitialAdPluginEvents.Dismissed, listenerFunc: () => void) => PluginListenerHandle
680
+ ```
681
+
682
+ | Param | Type |
683
+ | ------------------ | ------------------------------------------------------------------------------------------- |
684
+ | **`eventName`** | <code><a href="#interstitialadpluginevents">InterstitialAdPluginEvents.Dismissed</a></code> |
685
+ | **`listenerFunc`** | <code>() =&gt; void</code> |
686
+
687
+ **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
688
+
689
+ --------------------
690
+
691
+
692
+ ### addListener(InterstitialAdPluginEvents.FailedToShow, ...)
693
+
694
+ ```typescript
695
+ addListener(eventName: InterstitialAdPluginEvents.FailedToShow, listenerFunc: (error: AdMobError) => void) => PluginListenerHandle
696
+ ```
697
+
698
+ | Param | Type |
699
+ | ------------------ | ---------------------------------------------------------------------------------------------- |
700
+ | **`eventName`** | <code><a href="#interstitialadpluginevents">InterstitialAdPluginEvents.FailedToShow</a></code> |
701
+ | **`listenerFunc`** | <code>(error: <a href="#admoberror">AdMobError</a>) =&gt; void</code> |
702
+
703
+ **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
704
+
705
+ --------------------
706
+
707
+
708
+ ### addListener(InterstitialAdPluginEvents.Showed, ...)
709
+
710
+ ```typescript
711
+ addListener(eventName: InterstitialAdPluginEvents.Showed, listenerFunc: () => void) => PluginListenerHandle
712
+ ```
713
+
714
+ | Param | Type |
715
+ | ------------------ | ---------------------------------------------------------------------------------------- |
716
+ | **`eventName`** | <code><a href="#interstitialadpluginevents">InterstitialAdPluginEvents.Showed</a></code> |
717
+ | **`listenerFunc`** | <code>() =&gt; void</code> |
718
+
719
+ **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
720
+
721
+ --------------------
722
+
723
+
724
+ ### prepareRewardVideoAd(...)
725
+
726
+ ```typescript
727
+ prepareRewardVideoAd(options: RewardAdOptions) => Promise<AdLoadInfo>
728
+ ```
729
+
730
+ Prepare a reward video ad
731
+
732
+ | Param | Type | Description |
733
+ | ------------- | ----------------------------------------------------------- | ---------------------------------------------- |
734
+ | **`options`** | <code><a href="#rewardadoptions">RewardAdOptions</a></code> | <a href="#rewardadoptions">RewardAdOptions</a> |
735
+
736
+ **Returns:** <code>Promise&lt;<a href="#adloadinfo">AdLoadInfo</a>&gt;</code>
737
+
738
+ --------------------
739
+
740
+
741
+ ### showRewardVideoAd()
742
+
743
+ ```typescript
744
+ showRewardVideoAd() => Promise<AdMobRewardItem>
745
+ ```
746
+
747
+ Show a reward video ad
748
+
749
+ **Returns:** <code>Promise&lt;<a href="#admobrewarditem">AdMobRewardItem</a>&gt;</code>
750
+
751
+ --------------------
752
+
753
+
754
+ ### addListener(RewardAdPluginEvents.FailedToLoad, ...)
755
+
756
+ ```typescript
757
+ addListener(eventName: RewardAdPluginEvents.FailedToLoad, listenerFunc: (error: AdMobError) => void) => PluginListenerHandle
758
+ ```
759
+
760
+ | Param | Type |
761
+ | ------------------ | ---------------------------------------------------------------------------------- |
762
+ | **`eventName`** | <code><a href="#rewardadpluginevents">RewardAdPluginEvents.FailedToLoad</a></code> |
763
+ | **`listenerFunc`** | <code>(error: <a href="#admoberror">AdMobError</a>) =&gt; void</code> |
764
+
765
+ **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
766
+
767
+ --------------------
768
+
769
+
770
+ ### addListener(RewardAdPluginEvents.Loaded, ...)
771
+
772
+ ```typescript
773
+ addListener(eventName: RewardAdPluginEvents.Loaded, listenerFunc: (info: AdLoadInfo) => void) => PluginListenerHandle
774
+ ```
775
+
776
+ | Param | Type |
777
+ | ------------------ | ---------------------------------------------------------------------------- |
778
+ | **`eventName`** | <code><a href="#rewardadpluginevents">RewardAdPluginEvents.Loaded</a></code> |
779
+ | **`listenerFunc`** | <code>(info: <a href="#adloadinfo">AdLoadInfo</a>) =&gt; void</code> |
780
+
781
+ **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
782
+
783
+ --------------------
784
+
785
+
786
+ ### addListener(RewardAdPluginEvents.Rewarded, ...)
787
+
788
+ ```typescript
789
+ addListener(eventName: RewardAdPluginEvents.Rewarded, listenerFunc: (reward: AdMobRewardItem) => void) => PluginListenerHandle
790
+ ```
791
+
792
+ | Param | Type |
793
+ | ------------------ | -------------------------------------------------------------------------------- |
794
+ | **`eventName`** | <code><a href="#rewardadpluginevents">RewardAdPluginEvents.Rewarded</a></code> |
795
+ | **`listenerFunc`** | <code>(reward: <a href="#admobrewarditem">AdMobRewardItem</a>) =&gt; void</code> |
796
+
797
+ **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
798
+
799
+ --------------------
800
+
801
+
802
+ ### addListener(RewardAdPluginEvents.Dismissed, ...)
803
+
804
+ ```typescript
805
+ addListener(eventName: RewardAdPluginEvents.Dismissed, listenerFunc: () => void) => PluginListenerHandle
806
+ ```
807
+
808
+ | Param | Type |
809
+ | ------------------ | ------------------------------------------------------------------------------- |
810
+ | **`eventName`** | <code><a href="#rewardadpluginevents">RewardAdPluginEvents.Dismissed</a></code> |
811
+ | **`listenerFunc`** | <code>() =&gt; void</code> |
812
+
813
+ **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
814
+
815
+ --------------------
816
+
817
+
818
+ ### addListener(RewardAdPluginEvents.FailedToShow, ...)
819
+
820
+ ```typescript
821
+ addListener(eventName: RewardAdPluginEvents.FailedToShow, listenerFunc: (error: AdMobError) => void) => PluginListenerHandle
822
+ ```
823
+
824
+ | Param | Type |
825
+ | ------------------ | ---------------------------------------------------------------------------------- |
826
+ | **`eventName`** | <code><a href="#rewardadpluginevents">RewardAdPluginEvents.FailedToShow</a></code> |
827
+ | **`listenerFunc`** | <code>(error: <a href="#admoberror">AdMobError</a>) =&gt; void</code> |
828
+
829
+ **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
830
+
831
+ --------------------
832
+
833
+
834
+ ### addListener(RewardAdPluginEvents.Showed, ...)
835
+
836
+ ```typescript
837
+ addListener(eventName: RewardAdPluginEvents.Showed, listenerFunc: () => void) => PluginListenerHandle
838
+ ```
839
+
840
+ | Param | Type |
841
+ | ------------------ | ---------------------------------------------------------------------------- |
842
+ | **`eventName`** | <code><a href="#rewardadpluginevents">RewardAdPluginEvents.Showed</a></code> |
843
+ | **`listenerFunc`** | <code>() =&gt; void</code> |
844
+
845
+ **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
846
+
847
+ --------------------
848
+
849
+
850
+ ### Interfaces
851
+
852
+
853
+ #### AdMobInitializationOptions
854
+
855
+ | Prop | Type | Description |
856
+ | ---------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
857
+ | **`testingDevices`** | <code>string[]</code> | An Array of devices IDs that will be marked as tested devices if {@link <a href="#admobinitializationoptions">AdMobInitializationOptions.initializeForTesting</a>} is true (Real Ads will be served to Testing devices, but they will not count as 'real'). |
858
+ | **`initializeForTesting`** | <code>boolean</code> | If set to true, the devices on {@link <a href="#admobinitializationoptions">AdMobInitializationOptions.testingDevices</a>} will be registered to receive test production ads. |
859
+ | **`tagForChildDirectedTreatment`** | <code>boolean</code> | For purposes of the Children's Online Privacy Protection Act (COPPA), there is a setting called tagForChildDirectedTreatment. |
860
+ | **`tagForUnderAgeOfConsent`** | <code>boolean</code> | When using this feature, a Tag For Users under the Age of Consent in Europe (TFUA) parameter will be included in all future ad requests. |
861
+ | **`maxAdContentRating`** | <code><a href="#maxadcontentrating">MaxAdContentRating</a></code> | As an app developer, you can indicate whether you want Google to treat your content as child-directed when you make an ad request. |
862
+
863
+
864
+ #### TrackingAuthorizationStatusInterface
865
+
866
+ | Prop | Type |
867
+ | ------------ | ------------------------------------------------------------------------ |
868
+ | **`status`** | <code>'authorized' \| 'denied' \| 'notDetermined' \| 'restricted'</code> |
869
+
870
+
871
+ #### ApplicationMutedOptions
872
+
873
+ | Prop | Type | Description |
874
+ | ----------- | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
875
+ | **`muted`** | <code>boolean</code> | To inform the SDK that the app volume has been muted. Note: Video ads that are ineligible to be shown with muted audio are not returned for ad requests made, when the app volume is reported as muted or set to a value of 0. This may restrict a subset of the broader video ads pool from serving. |
876
+
877
+
878
+ #### ApplicationVolumeOptions
879
+
880
+ | Prop | Type | Description |
881
+ | ------------ | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
882
+ | **`volume`** | <code>0 \| 1 \| 0.1 \| 0.2 \| 0.3 \| 0.4 \| 0.5 \| 0.6 \| 0.7 \| 0.8 \| 0.9</code> | If your app has its own volume controls (such as custom music or sound effect volumes), disclosing app volume to the Google Mobile Ads SDK allows video ads to respect app volume settings. enable set 0.0 - 1.0, any float allowed. |
883
+
884
+
885
+ #### BannerAdOptions
886
+
887
+ This interface extends <a href="#adoptions">AdOptions</a>
888
+
889
+ | Prop | Type | Description |
890
+ | -------------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
891
+ | **`adSize`** | <code><a href="#banneradsize">BannerAdSize</a></code> | Banner Ad Size, defaults to ADAPTIVE_BANNER. IT can be: ADAPTIVE_BANNER, SMART_BANNER, BANNER, MEDIUM_RECTANGLE, FULL_BANNER, LEADERBOARD |
892
+ | **`position`** | <code><a href="#banneradposition">BannerAdPosition</a></code> | Set Banner Ad position. TOP_CENTER or CENTER or BOTTOM_CENTER |
893
+
894
+
895
+ #### PluginListenerHandle
896
+
897
+ | Prop | Type |
898
+ | ------------ | ----------------------------------------- |
899
+ | **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |
900
+
901
+
902
+ #### AdMobBannerSize
903
+
904
+ When notice listener of OnAdLoaded, you can get banner size.
905
+
906
+ | Prop | Type |
907
+ | ------------ | ------------------- |
908
+ | **`width`** | <code>number</code> |
909
+ | **`height`** | <code>number</code> |
910
+
911
+
912
+ #### AdMobError
913
+
914
+ For more information
915
+ https://developers.google.com/android/reference/com/google/android/gms/ads/AdError
916
+
917
+ | Prop | Type | Description |
918
+ | ------------- | ------------------- | -------------------------------------- |
919
+ | **`code`** | <code>number</code> | Gets the error's code. |
920
+ | **`message`** | <code>string</code> | Gets the message describing the error. |
921
+
922
+
923
+ #### AdmobConsentInfo
924
+
925
+ | Prop | Type | Description |
926
+ | ---------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------- |
927
+ | **`status`** | <code><a href="#admobconsentstatus">AdmobConsentStatus</a></code> | The consent status of the user. |
928
+ | **`isConsentFormAvailable`** | <code>boolean</code> | If `true` a consent form is available and vice versa. |
929
+
930
+
931
+ #### AdmobConsentRequestOptions
932
+
933
+ | Prop | Type | Description |
934
+ | ----------------------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
935
+ | **`debugGeography`** | <code><a href="#admobconsentdebuggeography">AdmobConsentDebugGeography</a></code> | Sets the debug geography to test the consent locally. |
936
+ | **`testDeviceIdentifiers`** | <code>string[]</code> | An array of test device IDs to allow. Note: On iOS, the ID may renew if you uninstall and reinstall the app. |
937
+ | **`tagForUnderAgeOfConsent`** | <code>boolean</code> | Set to `true` to provide the option for the user to accept being shown personalized ads. |
938
+
939
+
940
+ #### AdLoadInfo
941
+
942
+ | Prop | Type |
943
+ | -------------- | ------------------- |
944
+ | **`adUnitId`** | <code>string</code> |
945
+
946
+
947
+ #### AdOptions
948
+
949
+ | Prop | Type | Description |
950
+ | --------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
951
+ | **`adId`** | <code>string</code> | The ad unit ID that you want to request |
952
+ | **`isTesting`** | <code>boolean</code> | You can use test mode of ad. |
953
+ | **`margin`** | <code>number</code> | Margin Banner. Default is 0px; If position is BOTTOM_CENTER, margin is be margin-bottom. If position is TOP_CENTER, margin is be margin-top. |
954
+ | **`npa`** | <code>boolean</code> | The default behavior of the Google Mobile Ads SDK is to serve personalized ads. Set this to true to request Non-Personalized Ads |
955
+
956
+
957
+ #### RewardAdOptions
958
+
959
+ | Prop | Type | Description |
960
+ | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
961
+ | **`ssv`** | <code><a href="#atleastone">AtLeastOne</a>&lt;{ /** * An optional UserId to pass to your SSV callback function. */ userId: string; /** * An optional custom set of data to pass to your SSV callback function. */ customData: string; }&gt;</code> | If you have enabled SSV in your AdMob Application. You can provide customData or a userId be passed to your callback to do further processing on. *Important* You *HAVE* to define one of them. |
962
+
963
+
964
+ #### AdMobRewardItem
965
+
966
+ For more information
967
+ https://developers.google.com/admob/android/rewarded-video-adapters?hl=en
968
+
969
+ | Prop | Type | Description |
970
+ | ------------ | ------------------- | ------------------------ |
971
+ | **`type`** | <code>string</code> | Rewarded type user got |
972
+ | **`amount`** | <code>number</code> | Rewarded amount user got |
973
+
974
+
975
+ ### Type Aliases
976
+
977
+
978
+ #### AtLeastOne
979
+
980
+ <code>{[K in keyof T]: <a href="#pick">Pick</a>&lt;T, K&gt;}[keyof T]</code>
981
+
982
+
983
+ #### Pick
984
+
985
+ From T, pick a set of properties whose keys are in the union K
986
+
987
+ <code>{
988
  [P in K]: T[P];
1
989
  }</code>
990
+
991
+
992
+ ### Enums
993
+
994
+
995
+ #### MaxAdContentRating
996
+
997
+ | Members | Value | Description |
998
+ | ---------------------- | ------------------------------- | ----------------------------------------------------------- |
999
+ | **`General`** | <code>'General'</code> | Content suitable for general audiences, including families. |
1000
+ | **`ParentalGuidance`** | <code>'ParentalGuidance'</code> | Content suitable for most audiences with parental guidance. |
1001
+ | **`Teen`** | <code>'Teen'</code> | Content suitable for teen and older audiences. |
1002
+ | **`MatureAudience`** | <code>'MatureAudience'</code> | Content suitable only for mature audiences. |
1003
+
1004
+
1005
+ #### BannerAdSize
1006
+
1007
+ | Members | Value | Description |
1008
+ | ---------------------- | ------------------------------- | --------------------------------------------------------------------------------------------------- |
1009
+ | **`BANNER`** | <code>'BANNER'</code> | Mobile Marketing Association (MMA) banner ad size (320x50 density-independent pixels). |
1010
+ | **`FULL_BANNER`** | <code>'FULL_BANNER'</code> | Interactive Advertising Bureau (IAB) full banner ad size (468x60 density-independent pixels). |
1011
+ | **`LARGE_BANNER`** | <code>'LARGE_BANNER'</code> | Large banner ad size (320x100 density-independent pixels). |
1012
+ | **`MEDIUM_RECTANGLE`** | <code>'MEDIUM_RECTANGLE'</code> | Interactive Advertising Bureau (IAB) medium rectangle ad size (300x250 density-independent pixels). |
1013
+ | **`LEADERBOARD`** | <code>'LEADERBOARD'</code> | Interactive Advertising Bureau (IAB) leaderboard ad size (728x90 density-independent pixels). |
1014
+ | **`ADAPTIVE_BANNER`** | <code>'ADAPTIVE_BANNER'</code> | A dynamically sized banner that is full-width and auto-height. |
1015
+ | **`SMART_BANNER`** | <code>'SMART_BANNER'</code> | |
1016
+
1017
+
1018
+ #### BannerAdPosition
1019
+
1020
+ | Members | Value | Description |
1021
+ | ------------------- | ---------------------------- | ----------------------------------------- |
1022
+ | **`TOP_CENTER`** | <code>'TOP_CENTER'</code> | Banner position be top-center |
1023
+ | **`CENTER`** | <code>'CENTER'</code> | Banner position be center |
1024
+ | **`BOTTOM_CENTER`** | <code>'BOTTOM_CENTER'</code> | Banner position be bottom-center(default) |
1025
+
1026
+
1027
+ #### BannerAdPluginEvents
1028
+
1029
+ | Members | Value | Description |
1030
+ | ------------------ | ----------------------------------- | ------------------------------------------------------------------------------------------------------ |
1031
+ | **`SizeChanged`** | <code>"bannerAdSizeChanged"</code> | |
1032
+ | **`Loaded`** | <code>"bannerAdLoaded"</code> | |
1033
+ | **`FailedToLoad`** | <code>"bannerAdFailedToLoad"</code> | |
1034
+ | **`Opened`** | <code>"bannerAdOpened"</code> | Open "Adsense" Event after user click banner |
1035
+ | **`Closed`** | <code>"bannerAdClosed"</code> | Close "Adsense" Event after user click banner |
1036
+ | **`AdImpression`** | <code>"bannerAdImpression"</code> | Similarly, this method should be called when an impression is recorded for the ad by the mediated SDK. |
1037
+
1038
+
1039
+ #### AdmobConsentStatus
1040
+
1041
+ | Members | Value | Description |
1042
+ | ------------------ | --------------------------- | ------------------------------------------------------------------------------------- |
1043
+ | **`NOT_REQUIRED`** | <code>'NOT_REQUIRED'</code> | User consent not required. |
1044
+ | **`OBTAINED`** | <code>'OBTAINED'</code> | User consent already obtained. |
1045
+ | **`REQUIRED`** | <code>'REQUIRED'</code> | User consent required but not yet obtained. |
1046
+ | **`UNKNOWN`** | <code>'UNKNOWN'</code> | Unknown consent status, AdsConsent.requestInfoUpdate needs to be called to update it. |
1047
+
1048
+
1049
+ #### AdmobConsentDebugGeography
1050
+
1051
+ | Members | Value | Description |
1052
+ | -------------- | -------------- | -------------------------------------------------- |
1053
+ | **`DISABLED`** | <code>0</code> | Debug geography disabled. |
1054
+ | **`EEA`** | <code>1</code> | Geography appears as in EEA for debug devices. |
1055
+ | **`NOT_EEA`** | <code>2</code> | Geography appears as not in EEA for debug devices. |
1056
+
1057
+
1058
+ #### InterstitialAdPluginEvents
1059
+
1060
+ | Members | Value | Description |
1061
+ | ------------------ | ----------------------------------------- | -------------------------------------------------------------------------------------- |
1062
+ | **`Loaded`** | <code>'interstitialAdLoaded'</code> | Emits after trying to prepare and Interstitial, when it is loaded and ready to be show |
1063
+ | **`FailedToLoad`** | <code>'interstitialAdFailedToLoad'</code> | Emits after trying to prepare and Interstitial, when it could not be loaded |
1064
+ | **`Showed`** | <code>'interstitialAdShowed'</code> | Emits when the Interstitial ad is visible to the user |
1065
+ | **`FailedToShow`** | <code>'interstitialAdFailedToShow'</code> | Emits when the Interstitial ad is failed to show |
1066
+ | **`Dismissed`** | <code>'interstitialAdDismissed'</code> | Emits when the Interstitial ad is not visible to the user anymore. |
1067
+
1068
+
1069
+ #### RewardAdPluginEvents
1070
+
1071
+ | Members | Value | Description |
1072
+ | ------------------ | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1073
+ | **`Loaded`** | <code>'onRewardedVideoAdLoaded'</code> | Emits after trying to prepare a RewardAd and the Video is loaded and ready to be show |
1074
+ | **`FailedToLoad`** | <code>'onRewardedVideoAdFailedToLoad'</code> | Emits after trying to prepare a RewardAd when it could not be loaded |
1075
+ | **`Showed`** | <code>'onRewardedVideoAdShowed'</code> | Emits when the AdReward video is visible to the user |
1076
+ | **`FailedToShow`** | <code>'onRewardedVideoAdFailedToShow'</code> | Emits when the AdReward video is failed to show |
1077
+ | **`Dismissed`** | <code>'onRewardedVideoAdDismissed'</code> | Emits when the AdReward video is not visible to the user anymore. **Important**: This has nothing to do with the reward it self. This event will emits in this two cases: 1. The user starts the video ad but close it before the reward emit. 2. The user start the video and see it until end, then gets the reward and after that the ad is closed. |
1078
+ | **`Rewarded`** | <code>'onRewardedVideoAdReward'</code> | Emits when user get rewarded from AdReward |
1079
+
1080
+ </docgen-api>
1081
+
1082
+ ## TROUBLE SHOOTING
1083
+
1084
+ ### If you have error:
1085
+
1086
+ > [error] Error running update: Analyzing dependencies
1087
+ > [!] CocoaPods could not find compatible versions for pod "Google-Mobile-Ads-SDK":
1088
+
1089
+ You should run `pod repo update` ;
1090
+
1091
+ ## License
1092
+
1093
+ Capacitor AdMob is [MIT licensed](./LICENSE).