@capacitor-community/admob 4.0.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CapacitorCommunityAdmob.podspec +1 -1
- package/README.md +56 -18
- package/android/build.gradle +5 -2
- package/android/src/main/java/com/getcapacitor/community/admob/AdMob.java +22 -0
- package/dist/docs.json +189 -3
- package/dist/esm/definitions.d.ts +37 -1
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +3 -1
- package/dist/esm/web.js +6 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +6 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +6 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/Banner/BannerExecutor.swift +7 -7
- package/ios/Plugin/Interstitial/AdInterstitialExecutor.swift +6 -4
- package/ios/Plugin/Plugin.m +2 -0
- package/ios/Plugin/Plugin.swift +38 -0
- package/ios/Plugin/Rewarded/AdRewardExecutor.swift +6 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
|
-
<img src="https://img.shields.io/maintenance/yes/
|
|
9
|
+
<img src="https://img.shields.io/maintenance/yes/2023?style=flat-square" />
|
|
10
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
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
12
|
<br>
|
|
@@ -46,33 +46,19 @@ Made with [contributors-img](https://contrib.rocks).
|
|
|
46
46
|
If you use capacitor 4:
|
|
47
47
|
|
|
48
48
|
```
|
|
49
|
-
% npm install --save @capacitor-community/admob@
|
|
49
|
+
% npm install --save @capacitor-community/admob@latest
|
|
50
50
|
% npx cap update
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
capacitor 3:
|
|
54
54
|
|
|
55
55
|
```
|
|
56
|
-
% npm install --save @capacitor-community/admob
|
|
56
|
+
% npm install --save @capacitor-community/admob@3.3.0
|
|
57
57
|
% npx cap update
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
### Android configuration
|
|
61
61
|
|
|
62
|
-
In file `android/app/src/main/java/**/**/MainActivity.java`, add the plugin to the initialization list:
|
|
63
|
-
|
|
64
|
-
```java
|
|
65
|
-
import android.os.Bundle;
|
|
66
|
-
|
|
67
|
-
public class MainActivity extends BridgeActivity {
|
|
68
|
-
@Override
|
|
69
|
-
public void onCreate(Bundle savedInstanceState) {
|
|
70
|
-
super.onCreate(savedInstanceState);
|
|
71
|
-
registerPlugin(com.getcapacitor.community.admob.AdMob.class);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
```
|
|
75
|
-
|
|
76
62
|
In file `android/app/src/main/AndroidManifest.xml`, add the following XML elements under `<manifest><application>` :
|
|
77
63
|
|
|
78
64
|
```xml
|
|
@@ -89,6 +75,12 @@ In file `android/app/src/main/res/values/strings.xml` add the following lines :
|
|
|
89
75
|
|
|
90
76
|
Don't forget to replace `[APP_ID]` by your AdMob application Id.
|
|
91
77
|
|
|
78
|
+
#### Variables
|
|
79
|
+
|
|
80
|
+
This plugin will use the following project variables (defined in your app's `variables.gradle` file):
|
|
81
|
+
|
|
82
|
+
- `$playServicesAdsVersion` version of `com.google.android.gms:play-services-ads` (default: `21.1.0`)
|
|
83
|
+
|
|
92
84
|
### iOS configuration
|
|
93
85
|
|
|
94
86
|
Add the following in the `ios/App/App/info.plist` file inside of the outermost `<dict>`:
|
|
@@ -262,6 +254,8 @@ AdMob.addListener(RewardAdPluginEvents.Rewarded, async () => {
|
|
|
262
254
|
|
|
263
255
|
* [`initialize(...)`](#initialize)
|
|
264
256
|
* [`trackingAuthorizationStatus()`](#trackingauthorizationstatus)
|
|
257
|
+
* [`setApplicationMuted(...)`](#setapplicationmuted)
|
|
258
|
+
* [`setApplicationVolume(...)`](#setapplicationvolume)
|
|
265
259
|
* [`showBanner(...)`](#showbanner)
|
|
266
260
|
* [`hideBanner()`](#hidebanner)
|
|
267
261
|
* [`resumeBanner()`](#resumebanner)
|
|
@@ -325,6 +319,36 @@ Confirm requestTrackingAuthorization status (iOS >14)
|
|
|
325
319
|
--------------------
|
|
326
320
|
|
|
327
321
|
|
|
322
|
+
### setApplicationMuted(...)
|
|
323
|
+
|
|
324
|
+
```typescript
|
|
325
|
+
setApplicationMuted(options: ApplicationMutedOptions) => Promise<void>
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Report application mute state to AdMob SDK
|
|
329
|
+
|
|
330
|
+
| Param | Type |
|
|
331
|
+
| ------------- | --------------------------------------------------------------------------- |
|
|
332
|
+
| **`options`** | <code><a href="#applicationmutedoptions">ApplicationMutedOptions</a></code> |
|
|
333
|
+
|
|
334
|
+
--------------------
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
### setApplicationVolume(...)
|
|
338
|
+
|
|
339
|
+
```typescript
|
|
340
|
+
setApplicationVolume(options: ApplicationVolumeOptions) => Promise<void>
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
Report application volume to AdMob SDK
|
|
344
|
+
|
|
345
|
+
| Param | Type |
|
|
346
|
+
| ------------- | ----------------------------------------------------------------------------- |
|
|
347
|
+
| **`options`** | <code><a href="#applicationvolumeoptions">ApplicationVolumeOptions</a></code> |
|
|
348
|
+
|
|
349
|
+
--------------------
|
|
350
|
+
|
|
351
|
+
|
|
328
352
|
### showBanner(...)
|
|
329
353
|
|
|
330
354
|
```typescript
|
|
@@ -725,7 +749,7 @@ addListener(eventName: RewardAdPluginEvents.Showed, listenerFunc: () => void) =>
|
|
|
725
749
|
| **`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. |
|
|
726
750
|
| **`tagForChildDirectedTreatment`** | <code>boolean</code> | For purposes of the Children's Online Privacy Protection Act (COPPA), there is a setting called tagForChildDirectedTreatment. |
|
|
727
751
|
| **`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. |
|
|
728
|
-
| **`maxAdContentRating`** | <code><a href="#maxadcontentrating">MaxAdContentRating</a></code> |
|
|
752
|
+
| **`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. |
|
|
729
753
|
|
|
730
754
|
|
|
731
755
|
#### TrackingAuthorizationStatusInterface
|
|
@@ -735,6 +759,20 @@ addListener(eventName: RewardAdPluginEvents.Showed, listenerFunc: () => void) =>
|
|
|
735
759
|
| **`status`** | <code>'authorized' \| 'denied' \| 'notDetermined' \| 'restricted'</code> |
|
|
736
760
|
|
|
737
761
|
|
|
762
|
+
#### ApplicationMutedOptions
|
|
763
|
+
|
|
764
|
+
| Prop | Type | Description |
|
|
765
|
+
| ----------- | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
766
|
+
| **`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. |
|
|
767
|
+
|
|
768
|
+
|
|
769
|
+
#### ApplicationVolumeOptions
|
|
770
|
+
|
|
771
|
+
| Prop | Type | Description |
|
|
772
|
+
| ------------ | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
773
|
+
| **`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. |
|
|
774
|
+
|
|
775
|
+
|
|
738
776
|
#### BannerAdOptions
|
|
739
777
|
|
|
740
778
|
This interface extends <a href="#adoptions">AdOptions</a>
|
package/android/build.gradle
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
ext {
|
|
2
2
|
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
3
|
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.4.2'
|
|
4
|
+
androidxCoordinatorLayoutVersion = project.hasProperty('androidxCoordinatorLayoutVersion') ? rootProject.ext.androidxCoordinatorLayoutVersion : '1.2.0'
|
|
4
5
|
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3'
|
|
5
6
|
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'
|
|
7
|
+
playServicesAdsVersion = project.hasProperty('playServicesAdsVersion') ? rootProject.ext.playServicesAdsVersion : '21.5.0'
|
|
8
|
+
|
|
6
9
|
}
|
|
7
10
|
|
|
8
11
|
buildscript {
|
|
@@ -72,9 +75,9 @@ dependencies {
|
|
|
72
75
|
// androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
73
76
|
|
|
74
77
|
// after 20.5.0, require minCompileSdk (31)
|
|
75
|
-
implementation
|
|
78
|
+
implementation "com.google.android.gms:play-services-ads:$playServicesAdsVersion"
|
|
76
79
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
77
|
-
implementation "androidx.coordinatorlayout:coordinatorlayout
|
|
80
|
+
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
|
|
78
81
|
implementation "androidx.core:core-ktx:1.6.0"
|
|
79
82
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
80
83
|
}
|
|
@@ -73,6 +73,28 @@ public class AdMob extends Plugin {
|
|
|
73
73
|
call.resolve(response);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
@PluginMethod
|
|
77
|
+
public void setApplicationMuted(final PluginCall call) {
|
|
78
|
+
Boolean muted = call.getBoolean("muted");
|
|
79
|
+
if (muted == null) {
|
|
80
|
+
call.reject("muted property cannot be null");
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
MobileAds.setAppMuted(muted);
|
|
84
|
+
call.resolve();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@PluginMethod
|
|
88
|
+
public void setApplicationVolume(final PluginCall call) {
|
|
89
|
+
Float volume = call.getFloat("volume");
|
|
90
|
+
if (volume == null) {
|
|
91
|
+
call.reject("volume property cannot be null");
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
MobileAds.setAppVolume(volume);
|
|
95
|
+
call.resolve();
|
|
96
|
+
}
|
|
97
|
+
|
|
76
98
|
// Show a banner Ad
|
|
77
99
|
@PluginMethod
|
|
78
100
|
public void showBanner(final PluginCall call) {
|
package/dist/docs.json
CHANGED
|
@@ -94,6 +94,88 @@
|
|
|
94
94
|
],
|
|
95
95
|
"slug": "trackingauthorizationstatus"
|
|
96
96
|
},
|
|
97
|
+
{
|
|
98
|
+
"name": "setApplicationMuted",
|
|
99
|
+
"signature": "(options: ApplicationMutedOptions) => Promise<void>",
|
|
100
|
+
"parameters": [
|
|
101
|
+
{
|
|
102
|
+
"name": "options",
|
|
103
|
+
"docs": "",
|
|
104
|
+
"type": "ApplicationMutedOptions"
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"returns": "Promise<void>",
|
|
108
|
+
"tags": [
|
|
109
|
+
{
|
|
110
|
+
"name": "see",
|
|
111
|
+
"text": [
|
|
112
|
+
{
|
|
113
|
+
"text": "https",
|
|
114
|
+
"kind": "text"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"text": "://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547038-trackingauthorizationstatus",
|
|
118
|
+
"kind": "text"
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "since",
|
|
124
|
+
"text": [
|
|
125
|
+
{
|
|
126
|
+
"text": "4.1.1",
|
|
127
|
+
"kind": "text"
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
"docs": "Report application mute state to AdMob SDK",
|
|
133
|
+
"complexTypes": [
|
|
134
|
+
"ApplicationMutedOptions"
|
|
135
|
+
],
|
|
136
|
+
"slug": "setapplicationmuted"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "setApplicationVolume",
|
|
140
|
+
"signature": "(options: ApplicationVolumeOptions) => Promise<void>",
|
|
141
|
+
"parameters": [
|
|
142
|
+
{
|
|
143
|
+
"name": "options",
|
|
144
|
+
"docs": "",
|
|
145
|
+
"type": "ApplicationVolumeOptions"
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
"returns": "Promise<void>",
|
|
149
|
+
"tags": [
|
|
150
|
+
{
|
|
151
|
+
"name": "see",
|
|
152
|
+
"text": [
|
|
153
|
+
{
|
|
154
|
+
"text": "https",
|
|
155
|
+
"kind": "text"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"text": "://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547038-trackingauthorizationstatus",
|
|
159
|
+
"kind": "text"
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"name": "since",
|
|
165
|
+
"text": [
|
|
166
|
+
{
|
|
167
|
+
"text": "4.1.1",
|
|
168
|
+
"kind": "text"
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
],
|
|
173
|
+
"docs": "Report application volume to AdMob SDK",
|
|
174
|
+
"complexTypes": [
|
|
175
|
+
"ApplicationVolumeOptions"
|
|
176
|
+
],
|
|
177
|
+
"slug": "setapplicationvolume"
|
|
178
|
+
},
|
|
97
179
|
{
|
|
98
180
|
"name": "showBanner",
|
|
99
181
|
"signature": "(options: BannerAdOptions) => Promise<void>",
|
|
@@ -1101,7 +1183,9 @@
|
|
|
1101
1183
|
"TrackingAuthorizationStatusInterface",
|
|
1102
1184
|
"AdMobDefinitions",
|
|
1103
1185
|
"AdMobInitializationOptions",
|
|
1104
|
-
"MaxAdContentRating"
|
|
1186
|
+
"MaxAdContentRating",
|
|
1187
|
+
"ApplicationMutedOptions",
|
|
1188
|
+
"ApplicationVolumeOptions"
|
|
1105
1189
|
]
|
|
1106
1190
|
},
|
|
1107
1191
|
"interfaces": [
|
|
@@ -1301,7 +1385,7 @@
|
|
|
1301
1385
|
"name": "since"
|
|
1302
1386
|
}
|
|
1303
1387
|
],
|
|
1304
|
-
"docs": "
|
|
1388
|
+
"docs": "As an app developer,\nyou can indicate whether you want Google to treat your content as child-directed when you make an ad request.",
|
|
1305
1389
|
"complexTypes": [
|
|
1306
1390
|
"MaxAdContentRating"
|
|
1307
1391
|
],
|
|
@@ -1315,7 +1399,9 @@
|
|
|
1315
1399
|
"TrackingAuthorizationStatusInterface",
|
|
1316
1400
|
"AdMobDefinitions",
|
|
1317
1401
|
"AdMobPlugin",
|
|
1318
|
-
"MaxAdContentRating"
|
|
1402
|
+
"MaxAdContentRating",
|
|
1403
|
+
"ApplicationMutedOptions",
|
|
1404
|
+
"ApplicationVolumeOptions"
|
|
1319
1405
|
]
|
|
1320
1406
|
},
|
|
1321
1407
|
{
|
|
@@ -1345,6 +1431,106 @@
|
|
|
1345
1431
|
],
|
|
1346
1432
|
"importObject": []
|
|
1347
1433
|
},
|
|
1434
|
+
{
|
|
1435
|
+
"name": "ApplicationMutedOptions",
|
|
1436
|
+
"slug": "applicationmutedoptions",
|
|
1437
|
+
"docs": "",
|
|
1438
|
+
"tags": [],
|
|
1439
|
+
"methods": [],
|
|
1440
|
+
"properties": [
|
|
1441
|
+
{
|
|
1442
|
+
"name": "muted",
|
|
1443
|
+
"tags": [
|
|
1444
|
+
{
|
|
1445
|
+
"text": [
|
|
1446
|
+
{
|
|
1447
|
+
"text": "https",
|
|
1448
|
+
"kind": "text"
|
|
1449
|
+
},
|
|
1450
|
+
{
|
|
1451
|
+
"text": "://developers.google.com/admob/android/global-settings",
|
|
1452
|
+
"kind": "text"
|
|
1453
|
+
}
|
|
1454
|
+
],
|
|
1455
|
+
"name": "see"
|
|
1456
|
+
},
|
|
1457
|
+
{
|
|
1458
|
+
"text": [
|
|
1459
|
+
{
|
|
1460
|
+
"text": "4.1.1",
|
|
1461
|
+
"kind": "text"
|
|
1462
|
+
}
|
|
1463
|
+
],
|
|
1464
|
+
"name": "since"
|
|
1465
|
+
}
|
|
1466
|
+
],
|
|
1467
|
+
"docs": "To inform the SDK that the app volume has been muted.\nNote: Video ads that are ineligible to be shown with muted audio are not returned for ad requests made,\nwhen 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.",
|
|
1468
|
+
"complexTypes": [],
|
|
1469
|
+
"type": "boolean | undefined"
|
|
1470
|
+
}
|
|
1471
|
+
],
|
|
1472
|
+
"importObject": [
|
|
1473
|
+
"BannerDefinitions",
|
|
1474
|
+
"InterstitialDefinitions",
|
|
1475
|
+
"RewardDefinitions",
|
|
1476
|
+
"TrackingAuthorizationStatusInterface",
|
|
1477
|
+
"AdMobDefinitions",
|
|
1478
|
+
"AdMobPlugin",
|
|
1479
|
+
"AdMobInitializationOptions",
|
|
1480
|
+
"MaxAdContentRating",
|
|
1481
|
+
"ApplicationVolumeOptions"
|
|
1482
|
+
]
|
|
1483
|
+
},
|
|
1484
|
+
{
|
|
1485
|
+
"name": "ApplicationVolumeOptions",
|
|
1486
|
+
"slug": "applicationvolumeoptions",
|
|
1487
|
+
"docs": "",
|
|
1488
|
+
"tags": [],
|
|
1489
|
+
"methods": [],
|
|
1490
|
+
"properties": [
|
|
1491
|
+
{
|
|
1492
|
+
"name": "volume",
|
|
1493
|
+
"tags": [
|
|
1494
|
+
{
|
|
1495
|
+
"text": [
|
|
1496
|
+
{
|
|
1497
|
+
"text": "https",
|
|
1498
|
+
"kind": "text"
|
|
1499
|
+
},
|
|
1500
|
+
{
|
|
1501
|
+
"text": "://developers.google.com/admob/android/global-settings",
|
|
1502
|
+
"kind": "text"
|
|
1503
|
+
}
|
|
1504
|
+
],
|
|
1505
|
+
"name": "see"
|
|
1506
|
+
},
|
|
1507
|
+
{
|
|
1508
|
+
"text": [
|
|
1509
|
+
{
|
|
1510
|
+
"text": "4.1.1",
|
|
1511
|
+
"kind": "text"
|
|
1512
|
+
}
|
|
1513
|
+
],
|
|
1514
|
+
"name": "since"
|
|
1515
|
+
}
|
|
1516
|
+
],
|
|
1517
|
+
"docs": "If your app has its own volume controls (such as custom music or sound effect volumes),\ndisclosing app volume to the Google Mobile Ads SDK allows video ads to respect app volume settings.\nenable set 0.0 - 1.0, any float allowed.",
|
|
1518
|
+
"complexTypes": [],
|
|
1519
|
+
"type": "0 | 1 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | undefined"
|
|
1520
|
+
}
|
|
1521
|
+
],
|
|
1522
|
+
"importObject": [
|
|
1523
|
+
"BannerDefinitions",
|
|
1524
|
+
"InterstitialDefinitions",
|
|
1525
|
+
"RewardDefinitions",
|
|
1526
|
+
"TrackingAuthorizationStatusInterface",
|
|
1527
|
+
"AdMobDefinitions",
|
|
1528
|
+
"AdMobPlugin",
|
|
1529
|
+
"AdMobInitializationOptions",
|
|
1530
|
+
"MaxAdContentRating",
|
|
1531
|
+
"ApplicationMutedOptions"
|
|
1532
|
+
]
|
|
1533
|
+
},
|
|
1348
1534
|
{
|
|
1349
1535
|
"name": "BannerAdOptions",
|
|
1350
1536
|
"slug": "banneradoptions",
|
|
@@ -19,6 +19,20 @@ export interface AdMobPlugin extends AdMobDefinitions {
|
|
|
19
19
|
* @since 3.1.0
|
|
20
20
|
*/
|
|
21
21
|
trackingAuthorizationStatus(): Promise<TrackingAuthorizationStatusInterface>;
|
|
22
|
+
/**
|
|
23
|
+
* Report application mute state to AdMob SDK
|
|
24
|
+
*
|
|
25
|
+
* @see https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547038-trackingauthorizationstatus
|
|
26
|
+
* @since 4.1.1
|
|
27
|
+
*/
|
|
28
|
+
setApplicationMuted(options: ApplicationMutedOptions): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Report application volume to AdMob SDK
|
|
31
|
+
*
|
|
32
|
+
* @see https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547038-trackingauthorizationstatus
|
|
33
|
+
* @since 4.1.1
|
|
34
|
+
*/
|
|
35
|
+
setApplicationVolume(options: ApplicationVolumeOptions): Promise<void>;
|
|
22
36
|
}
|
|
23
37
|
export interface AdMobInitializationOptions {
|
|
24
38
|
/**
|
|
@@ -62,7 +76,7 @@ export interface AdMobInitializationOptions {
|
|
|
62
76
|
*/
|
|
63
77
|
tagForUnderAgeOfConsent?: boolean;
|
|
64
78
|
/**
|
|
65
|
-
*
|
|
79
|
+
* As an app developer,
|
|
66
80
|
* you can indicate whether you want Google to treat your content as child-directed when you make an ad request.
|
|
67
81
|
*
|
|
68
82
|
* @see https://developers.google.com/admob/android/targeting#child-directed_setting
|
|
@@ -88,4 +102,26 @@ export declare enum MaxAdContentRating {
|
|
|
88
102
|
*/
|
|
89
103
|
MatureAudience = "MatureAudience"
|
|
90
104
|
}
|
|
105
|
+
export interface ApplicationMutedOptions {
|
|
106
|
+
/**
|
|
107
|
+
* To inform the SDK that the app volume has been muted.
|
|
108
|
+
* Note: Video ads that are ineligible to be shown with muted audio are not returned for ad requests made,
|
|
109
|
+
* 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.
|
|
110
|
+
*
|
|
111
|
+
* @see https://developers.google.com/admob/android/global-settings
|
|
112
|
+
* @since 4.1.1
|
|
113
|
+
*/
|
|
114
|
+
muted?: boolean;
|
|
115
|
+
}
|
|
116
|
+
export interface ApplicationVolumeOptions {
|
|
117
|
+
/**
|
|
118
|
+
* If your app has its own volume controls (such as custom music or sound effect volumes),
|
|
119
|
+
* disclosing app volume to the Google Mobile Ads SDK allows video ads to respect app volume settings.
|
|
120
|
+
* enable set 0.0 - 1.0, any float allowed.
|
|
121
|
+
*
|
|
122
|
+
* @see https://developers.google.com/admob/android/global-settings
|
|
123
|
+
* @since 4.1.1
|
|
124
|
+
*/
|
|
125
|
+
volume?: 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1.0;
|
|
126
|
+
}
|
|
91
127
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAoGA,MAAM,CAAN,IAAY,kBAoBX;AApBD,WAAY,kBAAkB;IAC5B;;OAEG;IACH,yCAAmB,CAAA;IAEnB;;OAEG;IACH,2DAAqC,CAAA;IAErC;;OAEG;IACH,mCAAa,CAAA;IAEb;;OAEG;IACH,uDAAiC,CAAA;AACnC,CAAC,EApBW,kBAAkB,KAAlB,kBAAkB,QAoB7B"}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WebPlugin } from '@capacitor/core';
|
|
2
|
-
import type { AdMobPlugin } from '.';
|
|
2
|
+
import type { AdMobPlugin, ApplicationMutedOptions, ApplicationVolumeOptions } from '.';
|
|
3
3
|
import type { AdMobRewardItem } from './reward';
|
|
4
4
|
import type { AdOptions, AdLoadInfo } from './shared';
|
|
5
5
|
import type { TrackingAuthorizationStatusInterface } from './shared/tracking-authorization-status.interface';
|
|
@@ -8,6 +8,8 @@ export declare class AdMobWeb extends WebPlugin implements AdMobPlugin {
|
|
|
8
8
|
initialize(): Promise<void>;
|
|
9
9
|
targetSettings(): Promise<void>;
|
|
10
10
|
trackingAuthorizationStatus(): Promise<TrackingAuthorizationStatusInterface>;
|
|
11
|
+
setApplicationMuted(options: ApplicationMutedOptions): Promise<void>;
|
|
12
|
+
setApplicationVolume(options: ApplicationVolumeOptions): Promise<void>;
|
|
11
13
|
showBanner(options: AdOptions): Promise<void>;
|
|
12
14
|
hideBanner(): Promise<void>;
|
|
13
15
|
resumeBanner(): Promise<void>;
|
package/dist/esm/web.js
CHANGED
|
@@ -17,6 +17,12 @@ export class AdMobWeb extends WebPlugin {
|
|
|
17
17
|
status: 'authorized',
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
+
async setApplicationMuted(options) {
|
|
21
|
+
console.log('setApplicationMuted', options);
|
|
22
|
+
}
|
|
23
|
+
async setApplicationVolume(options) {
|
|
24
|
+
console.log('setApplicationVolume', options);
|
|
25
|
+
}
|
|
20
26
|
async showBanner(options) {
|
|
21
27
|
console.log('showBanner', options);
|
|
22
28
|
}
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW5C,MAAM,OAAO,QAAS,SAAQ,SAAS;IACrC;QACE,KAAK,CAAC;YACJ,IAAI,EAAE,OAAO;YACb,SAAS,EAAE,CAAC,KAAK,CAAC;SACnB,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,UAAU;QACd,OAAO,CAAC,GAAG,C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C,IAAI;SACvB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,OAAO;YACL,IAAI,EAAE,EAAE;YACR,MAAM,EAAE,CAAC;SACV,CAAC;IACJ,CAAC;CACF"}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -189,6 +189,12 @@ class AdMobWeb extends core.WebPlugin {
|
|
|
189
189
|
status: 'authorized',
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
|
+
async setApplicationMuted(options) {
|
|
193
|
+
console.log('setApplicationMuted', options);
|
|
194
|
+
}
|
|
195
|
+
async setApplicationVolume(options) {
|
|
196
|
+
console.log('setApplicationVolume', options);
|
|
197
|
+
}
|
|
192
198
|
async showBanner(options) {
|
|
193
199
|
console.log('showBanner', options);
|
|
194
200
|
}
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.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/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","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 './shared/index';\nexport { AdMob };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\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 trackingAuthorizationStatus() {\n return {\n status: 'authorized',\n };\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","registerPlugin","WebPlugin"],"mappings":";;;;;;AAAWA,oCAAmB;AAC9B,CAAC,UAAU,kBAAkB,EAAE;AAC/B;AACA;AACA;AACA,IAAI,kBAAkB,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;AAC9C;AACA;AACA;AACA,IAAI,kBAAkB,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAC;AAChE;AACA;AACA;AACA,IAAI,kBAAkB,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AACxC;AACA;AACA;AACA,IAAI,kBAAkB,CAAC,gBAAgB,CAAC,GAAG,gBAAgB,CAAC;AAC5D,CAAC,EAAEA,0BAAkB,KAAKA,0BAAkB,GAAG,EAAE,CAAC,CAAC;;AClBnD;AACWC,sCAAqB;AAChC,CAAC,UAAU,oBAAoB,EAAE;AACjC,IAAI,oBAAoB,CAAC,aAAa,CAAC,GAAG,qBAAqB,CAAC;AAChE,IAAI,oBAAoB,CAAC,QAAQ,CAAC,GAAG,gBAAgB,CAAC;AACtD,IAAI,oBAAoB,CAAC,cAAc,CAAC,GAAG,sBAAsB,CAAC;AAClE;AACA;AACA;AACA,IAAI,oBAAoB,CAAC,QAAQ,CAAC,GAAG,gBAAgB,CAAC;AACtD;AACA;AACA;AACA,IAAI,oBAAoB,CAAC,QAAQ,CAAC,GAAG,gBAAgB,CAAC;AACtD;AACA;AACA;AACA,IAAI,oBAAoB,CAAC,cAAc,CAAC,GAAG,oBAAoB,CAAC;AAChE,CAAC,EAAEA,4BAAoB,KAAKA,4BAAoB,GAAG,EAAE,CAAC,CAAC;;AClBvD;AAC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IAAI,MAAM,iBAAiB,GAAG;AAC9B,QAAQ,OAAO;AACf,YAAY,IAAI,EAAE,EAAE;AACpB,YAAY,MAAM,EAAE,CAAC;AACrB,SAAS,CAAC;AACV,KAAK;AACL;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.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/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","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 './shared/index';\nexport { AdMob };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\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 trackingAuthorizationStatus() {\n return {\n status: 'authorized',\n };\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","registerPlugin","WebPlugin"],"mappings":";;;;;;AAAWA,oCAAmB;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f,YAAY,IAAI,EAAE,EAAE;AACpB,YAAY,MAAM,EAAE,CAAC;AACrB,SAAS,CAAC;AACV,KAAK;AACL;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -186,6 +186,12 @@ var AdMobPlugin = (function (exports, core) {
|
|
|
186
186
|
status: 'authorized',
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
|
+
async setApplicationMuted(options) {
|
|
190
|
+
console.log('setApplicationMuted', options);
|
|
191
|
+
}
|
|
192
|
+
async setApplicationVolume(options) {
|
|
193
|
+
console.log('setApplicationVolume', options);
|
|
194
|
+
}
|
|
189
195
|
async showBanner(options) {
|
|
190
196
|
console.log('showBanner', options);
|
|
191
197
|
}
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +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/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","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 './shared/index';\nexport { AdMob };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\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 trackingAuthorizationStatus() {\n return {\n status: 'authorized',\n };\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","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,CAAC;IACxC;IACA;IACA;IACA,IAAI,kBAAkB,CAAC,gBAAgB,CAAC,GAAG,gBAAgB,CAAC;IAC5D,CAAC,EAAEA,0BAAkB,KAAKA,0BAAkB,GAAG,EAAE,CAAC,CAAC;;IClBnD;AACWC,0CAAqB;IAChC,CAAC,UAAU,oBAAoB,EAAE;IACjC,IAAI,oBAAoB,CAAC,aAAa,CAAC,GAAG,qBAAqB,CAAC;IAChE,IAAI,oBAAoB,CAAC,QAAQ,CAAC,GAAG,gBAAgB,CAAC;IACtD,IAAI,oBAAoB,CAAC,cAAc,CAAC,GAAG,sBAAsB,CAAC;IAClE;IACA;IACA;IACA,IAAI,oBAAoB,CAAC,QAAQ,CAAC,GAAG,gBAAgB,CAAC;IACtD;IACA;IACA;IACA,IAAI,oBAAoB,CAAC,QAAQ,CAAC,GAAG,gBAAgB,CAAC;IACtD;IACA;IACA;IACA,IAAI,oBAAoB,CAAC,cAAc,CAAC,GAAG,oBAAoB,CAAC;IAChE,CAAC,EAAEA,4BAAoB,KAAKA,4BAAoB,GAAG,EAAE,CAAC,CAAC;;IClBvD;IACA;IACA;AACWC,sCAAiB;IAC5B,CAAC,UAAU,gBAAgB,EAAE;IAC7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AI,EAAE,EAAE;IACpB,YAAY,MAAM,EAAE,CAAC;IACrB,SAAS,CAAC;IACV,KAAK;IACL;;;;;;;;;;;;;;;;;"}
|
|
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/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","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 './shared/index';\nexport { AdMob };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\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 trackingAuthorizationStatus() {\n return {\n status: 'authorized',\n };\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","registerPlugin","WebPlugin"],"mappings":";;;AAAWA,wCAAmB;IAC9B,CAAC,UAAU,kBAAkB,EAAE;IAC/B;IACA;IACA;IACA,IAA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rB,SAAS,CAAC;IACV,KAAK;IACL;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,11 +3,11 @@ import Capacitor
|
|
|
3
3
|
import GoogleMobileAds
|
|
4
4
|
|
|
5
5
|
class BannerExecutor: NSObject, GADBannerViewDelegate {
|
|
6
|
-
public weak var plugin:
|
|
6
|
+
public weak var plugin: AdMob?
|
|
7
7
|
var bannerView: GADBannerView!
|
|
8
8
|
|
|
9
9
|
func showBanner(_ call: CAPPluginCall, _ request: GADRequest, _ adUnitID: String) {
|
|
10
|
-
if let rootViewController =
|
|
10
|
+
if let rootViewController = plugin?.getRootVC() {
|
|
11
11
|
|
|
12
12
|
let adSize = call.getString("adSize") ?? "ADAPTIVE_BANNER"
|
|
13
13
|
let adPosition = call.getString("position") ?? "BOTTOM_CENTER"
|
|
@@ -53,7 +53,7 @@ class BannerExecutor: NSObject, GADBannerViewDelegate {
|
|
|
53
53
|
self.addBannerViewToView(self.bannerView, adPosition, adMargin)
|
|
54
54
|
self.bannerView.translatesAutoresizingMaskIntoConstraints = false
|
|
55
55
|
self.bannerView.adUnitID = adUnitID
|
|
56
|
-
self.bannerView.rootViewController =
|
|
56
|
+
self.bannerView.rootViewController = plugin?.getRootVC()
|
|
57
57
|
|
|
58
58
|
self.bannerView.load(request)
|
|
59
59
|
self.bannerView.delegate = self
|
|
@@ -64,7 +64,7 @@ class BannerExecutor: NSObject, GADBannerViewDelegate {
|
|
|
64
64
|
|
|
65
65
|
func hideBanner(_ call: CAPPluginCall) {
|
|
66
66
|
DispatchQueue.main.async {
|
|
67
|
-
if let rootViewController =
|
|
67
|
+
if let rootViewController = self.plugin?.getRootVC() {
|
|
68
68
|
if let subView = rootViewController.view.viewWithTag(2743243288699) {
|
|
69
69
|
NSLog("AdMob: find subView for hideBanner")
|
|
70
70
|
subView.isHidden = true
|
|
@@ -83,7 +83,7 @@ class BannerExecutor: NSObject, GADBannerViewDelegate {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
func resumeBanner(_ call: CAPPluginCall) {
|
|
86
|
-
if let rootViewController =
|
|
86
|
+
if let rootViewController = plugin?.getRootVC() {
|
|
87
87
|
if let subView = rootViewController.view.viewWithTag(2743243288699) {
|
|
88
88
|
NSLog("AdMob: find subView for resumeBanner")
|
|
89
89
|
subView.isHidden = false
|
|
@@ -109,7 +109,7 @@ class BannerExecutor: NSObject, GADBannerViewDelegate {
|
|
|
109
109
|
|
|
110
110
|
private func addBannerViewToView(_ bannerView: GADBannerView, _ adPosition: String, _ Margin: Int) {
|
|
111
111
|
removeBannerViewToView()
|
|
112
|
-
if let rootViewController =
|
|
112
|
+
if let rootViewController = plugin?.getRootVC() {
|
|
113
113
|
|
|
114
114
|
bannerView.translatesAutoresizingMaskIntoConstraints = false
|
|
115
115
|
bannerView.tag = 2743243288699 // rand
|
|
@@ -134,7 +134,7 @@ class BannerExecutor: NSObject, GADBannerViewDelegate {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
private func removeBannerViewToView() {
|
|
137
|
-
if let rootViewController =
|
|
137
|
+
if let rootViewController = plugin?.getRootVC() {
|
|
138
138
|
if let subView = rootViewController.view.viewWithTag(2743243288699) {
|
|
139
139
|
bannerView.delegate = nil
|
|
140
140
|
NSLog("AdMob: find subView")
|
|
@@ -3,7 +3,7 @@ import Capacitor
|
|
|
3
3
|
import GoogleMobileAds
|
|
4
4
|
|
|
5
5
|
class AdInterstitialExecutor: NSObject, GADFullScreenContentDelegate {
|
|
6
|
-
public weak var plugin:
|
|
6
|
+
public weak var plugin: AdMob?
|
|
7
7
|
var interstitial: GADInterstitialAd!
|
|
8
8
|
|
|
9
9
|
func prepareInterstitial(_ call: CAPPluginCall, _ request: GADRequest, _ adUnitID: String) {
|
|
@@ -26,13 +26,15 @@ class AdInterstitialExecutor: NSObject, GADFullScreenContentDelegate {
|
|
|
26
26
|
self.plugin?.notifyListeners(InterstitialAdPluginEvents.Loaded.rawValue, data: [
|
|
27
27
|
"adUnitId": adUnitID
|
|
28
28
|
])
|
|
29
|
-
call.resolve([
|
|
29
|
+
call.resolve([
|
|
30
|
+
"adUnitId": adUnitID
|
|
31
|
+
])
|
|
30
32
|
}
|
|
31
33
|
)
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
func showInterstitial(_ call: CAPPluginCall) {
|
|
35
|
-
if let rootViewController =
|
|
37
|
+
if let rootViewController = plugin?.getRootVC() {
|
|
36
38
|
if let ad = self.interstitial {
|
|
37
39
|
ad.present(fromRootViewController: rootViewController)
|
|
38
40
|
call.resolve([:])
|
|
@@ -50,7 +52,7 @@ class AdInterstitialExecutor: NSObject, GADFullScreenContentDelegate {
|
|
|
50
52
|
"message": error.localizedDescription
|
|
51
53
|
])
|
|
52
54
|
}
|
|
53
|
-
|
|
55
|
+
|
|
54
56
|
public func adWillPresentFullScreenContent(_ ad: GADFullScreenPresentingAd) {
|
|
55
57
|
NSLog("InterstitialFullScreenDelegate Ad did present full screen content.")
|
|
56
58
|
self.plugin?.notifyListeners(InterstitialAdPluginEvents.Showed.rawValue, data: [:])
|
package/ios/Plugin/Plugin.m
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
CAP_PLUGIN(AdMob, "AdMob",
|
|
7
7
|
CAP_PLUGIN_METHOD(initialize, CAPPluginReturnPromise);
|
|
8
8
|
CAP_PLUGIN_METHOD(trackingAuthorizationStatus, CAPPluginReturnPromise);
|
|
9
|
+
CAP_PLUGIN_METHOD(setApplicationMuted, CAPPluginReturnPromise);
|
|
10
|
+
CAP_PLUGIN_METHOD(setApplicationVolume, CAPPluginReturnPromise);
|
|
9
11
|
CAP_PLUGIN_METHOD(showBanner, CAPPluginReturnPromise);
|
|
10
12
|
CAP_PLUGIN_METHOD(resumeBanner, CAPPluginReturnPromise);
|
|
11
13
|
CAP_PLUGIN_METHOD(hideBanner, CAPPluginReturnPromise);
|
package/ios/Plugin/Plugin.swift
CHANGED
|
@@ -48,6 +48,31 @@ public class AdMob: CAPPlugin {
|
|
|
48
48
|
call.resolve([:])
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
+
|
|
52
|
+
@objc func setApplicationMuted(_ call: CAPPluginCall) {
|
|
53
|
+
if let shouldMute = call.getBool("muted") {
|
|
54
|
+
GADMobileAds.sharedInstance().applicationMuted = shouldMute
|
|
55
|
+
call.resolve([:])
|
|
56
|
+
} else {
|
|
57
|
+
call.reject("muted property cannot be null");
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@objc func setApplicationVolume(_ call: CAPPluginCall) {
|
|
63
|
+
if var volume = call.getFloat("volume") {
|
|
64
|
+
//Clamp volumes.
|
|
65
|
+
if (volume < 0.0) {volume = 0.0}
|
|
66
|
+
else if (volume > 1.0) {volume = 1.0}
|
|
67
|
+
|
|
68
|
+
GADMobileAds.sharedInstance().applicationVolume = volume
|
|
69
|
+
|
|
70
|
+
call.resolve([:])
|
|
71
|
+
} else {
|
|
72
|
+
call.reject("volume property cannot be null");
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
51
76
|
|
|
52
77
|
/**
|
|
53
78
|
* AdMob: Banner
|
|
@@ -201,4 +226,17 @@ public class AdMob: CAPPlugin {
|
|
|
201
226
|
}
|
|
202
227
|
|
|
203
228
|
}
|
|
229
|
+
|
|
230
|
+
func getRootVC() -> UIViewController? {
|
|
231
|
+
var window: UIWindow? = UIApplication.shared.delegate?.window ?? nil
|
|
232
|
+
|
|
233
|
+
if window == nil {
|
|
234
|
+
let scene: UIWindowScene? = UIApplication.shared.connectedScenes.first as? UIWindowScene
|
|
235
|
+
window = scene?.windows.filter({$0.isKeyWindow}).first
|
|
236
|
+
if window == nil {
|
|
237
|
+
window = scene?.windows.first
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return window?.rootViewController
|
|
241
|
+
}
|
|
204
242
|
}
|
|
@@ -3,7 +3,7 @@ import Capacitor
|
|
|
3
3
|
import GoogleMobileAds
|
|
4
4
|
|
|
5
5
|
class AdRewardExecutor: NSObject, GADFullScreenContentDelegate {
|
|
6
|
-
public weak var plugin:
|
|
6
|
+
public weak var plugin: AdMob?
|
|
7
7
|
var rewardedAd: GADRewardedAd!
|
|
8
8
|
|
|
9
9
|
func prepareRewardVideoAd(_ call: CAPPluginCall, _ request: GADRequest, _ adUnitID: String) {
|
|
@@ -43,13 +43,15 @@ class AdRewardExecutor: NSObject, GADFullScreenContentDelegate {
|
|
|
43
43
|
self.plugin?.notifyListeners(RewardAdPluginEvents.Loaded.rawValue, data: [
|
|
44
44
|
"adUnitId": adUnitID
|
|
45
45
|
])
|
|
46
|
-
call.resolve([
|
|
46
|
+
call.resolve([
|
|
47
|
+
"adUnitId": adUnitID
|
|
48
|
+
])
|
|
47
49
|
}
|
|
48
50
|
)
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
func showRewardVideoAd(_ call: CAPPluginCall) {
|
|
52
|
-
if let rootViewController =
|
|
54
|
+
if let rootViewController = plugin?.getRootVC() {
|
|
53
55
|
if let ad = self.rewardedAd {
|
|
54
56
|
ad.present(fromRootViewController: rootViewController,
|
|
55
57
|
userDidEarnRewardHandler: {
|
|
@@ -71,7 +73,7 @@ class AdRewardExecutor: NSObject, GADFullScreenContentDelegate {
|
|
|
71
73
|
"message": error.localizedDescription
|
|
72
74
|
])
|
|
73
75
|
}
|
|
74
|
-
|
|
76
|
+
|
|
75
77
|
public func adWillPresentFullScreenContent(_ ad: GADFullScreenPresentingAd) {
|
|
76
78
|
NSLog("RewardFullScreenDelegate Ad did present full screen content.")
|
|
77
79
|
self.plugin?.notifyListeners(RewardAdPluginEvents.Showed.rawValue, data: [:])
|