@capacitor-community/admob 6.0.0 → 6.2.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CapacitorCommunityAdmob.podspec +1 -1
- package/README.md +261 -66
- package/android/src/main/java/com/getcapacitor/community/admob/AdMob.java +17 -0
- package/android/src/main/java/com/getcapacitor/community/admob/models/AdOptions.java +10 -0
- package/android/src/main/java/com/getcapacitor/community/admob/rewardedinterstitial/AdRewardInterstitialExecutor.java +84 -0
- package/android/src/main/java/com/getcapacitor/community/admob/rewardedinterstitial/RewardInterstitialAdPluginEvents.kt +12 -0
- package/android/src/main/java/com/getcapacitor/community/admob/rewardedinterstitial/RewardedInterstitialAdCallbackAndListeners.kt +50 -0
- package/android/src/main/java/com/getcapacitor/community/admob/rewardedinterstitial/models/SsvInfo.kt +20 -0
- package/dist/docs.json +340 -0
- package/dist/esm/definitions.d.ts +2 -1
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/reward-interstitial/index.d.ts +4 -0
- package/dist/esm/reward-interstitial/index.js +5 -0
- package/dist/esm/reward-interstitial/index.js.map +1 -0
- package/dist/esm/reward-interstitial/reward-interstitial-ad-options.interface.d.ts +25 -0
- package/dist/esm/reward-interstitial/reward-interstitial-ad-options.interface.js +2 -0
- package/dist/esm/reward-interstitial/reward-interstitial-ad-options.interface.js.map +1 -0
- package/dist/esm/reward-interstitial/reward-interstitial-ad-plugin-events.enum.d.ts +32 -0
- package/dist/esm/reward-interstitial/reward-interstitial-ad-plugin-events.enum.js +35 -0
- package/dist/esm/reward-interstitial/reward-interstitial-ad-plugin-events.enum.js.map +1 -0
- package/dist/esm/reward-interstitial/reward-interstitial-definitions.interface.d.ts +30 -0
- package/dist/esm/reward-interstitial/reward-interstitial-definitions.interface.js +2 -0
- package/dist/esm/reward-interstitial/reward-interstitial-definitions.interface.js.map +1 -0
- package/dist/esm/reward-interstitial/reward-interstitial-item.interface.d.ts +14 -0
- package/dist/esm/reward-interstitial/reward-interstitial-item.interface.js +2 -0
- package/dist/esm/reward-interstitial/reward-interstitial-item.interface.js.map +1 -0
- package/dist/esm/web.d.ts +2 -0
- package/dist/esm/web.js +12 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +47 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +47 -0
- package/dist/plugin.js.map +1 -1
- package/package.json +10 -17
- package/ios/Plugin/Banner/BannerAdPluginEvents.swift +0 -8
- package/ios/Plugin/Banner/BannerAdSizeEnum.swift +0 -10
- package/ios/Plugin/Banner/BannerExecutor.swift +0 -186
- package/ios/Plugin/Consent/ConsentExecutor.swift +0 -87
- package/ios/Plugin/Helper/AuthorizationStatusEnum.swift +0 -6
- package/ios/Plugin/Info.plist +0 -24
- package/ios/Plugin/Interstitial/AdInterstitialExecutor.swift +0 -65
- package/ios/Plugin/Interstitial/InterstitialAdPluginEvents.swift +0 -7
- package/ios/Plugin/Models/FullScreenAdEventName.swift +0 -12
- package/ios/Plugin/Plugin.h +0 -10
- package/ios/Plugin/Plugin.m +0 -23
- package/ios/Plugin/Plugin.swift +0 -275
- package/ios/Plugin/Rewarded/AdRewardExecutor.swift +0 -86
- package/ios/Plugin/Rewarded/RewardAdPluginEvents.swift +0 -8
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
package com.getcapacitor.community.admob.rewardedinterstitial
|
|
2
|
+
|
|
3
|
+
import com.getcapacitor.JSObject
|
|
4
|
+
import com.getcapacitor.PluginCall
|
|
5
|
+
import com.getcapacitor.community.admob.helpers.FullscreenPluginCallback
|
|
6
|
+
import com.getcapacitor.community.admob.models.AdMobPluginError
|
|
7
|
+
import com.getcapacitor.community.admob.models.AdOptions
|
|
8
|
+
import com.google.android.gms.ads.LoadAdError
|
|
9
|
+
import com.google.android.gms.ads.OnUserEarnedRewardListener
|
|
10
|
+
import com.google.android.gms.ads.rewarded.RewardItem
|
|
11
|
+
import com.google.android.gms.ads.rewardedinterstitial.RewardedInterstitialAd
|
|
12
|
+
import com.google.android.gms.ads.rewardedinterstitial.RewardedInterstitialAdLoadCallback
|
|
13
|
+
import com.google.android.gms.common.util.BiConsumer
|
|
14
|
+
|
|
15
|
+
object RewardedInterstitialAdCallbackAndListeners {
|
|
16
|
+
|
|
17
|
+
fun getOnUserEarnedRewardListener(call: PluginCall, notifyListenersFunction: BiConsumer<String, JSObject>): OnUserEarnedRewardListener {
|
|
18
|
+
return OnUserEarnedRewardListener { item: RewardItem ->
|
|
19
|
+
val response = JSObject()
|
|
20
|
+
response.put("type", item.type)
|
|
21
|
+
.put("amount", item.amount)
|
|
22
|
+
notifyListenersFunction.accept(RewardInterstitialAdPluginEvents.Rewarded, response)
|
|
23
|
+
call.resolve(response)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
fun getRewardedAdLoadCallback(call: PluginCall, notifyListenersFunction: BiConsumer<String, JSObject>, adOptions: AdOptions): RewardedInterstitialAdLoadCallback {
|
|
28
|
+
return object : RewardedInterstitialAdLoadCallback() {
|
|
29
|
+
override fun onAdLoaded(ad: RewardedInterstitialAd) {
|
|
30
|
+
AdRewardInterstitialExecutor.mRewardedInterstitialAd = ad
|
|
31
|
+
AdRewardInterstitialExecutor.mRewardedInterstitialAd.fullScreenContentCallback = FullscreenPluginCallback(
|
|
32
|
+
RewardInterstitialAdPluginEvents, notifyListenersFunction)
|
|
33
|
+
|
|
34
|
+
val adInfo = JSObject()
|
|
35
|
+
adInfo.put("adUnitId", ad.adUnitId)
|
|
36
|
+
call.resolve(adInfo)
|
|
37
|
+
|
|
38
|
+
notifyListenersFunction.accept(RewardInterstitialAdPluginEvents.Loaded, adInfo)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
override fun onAdFailedToLoad(adError: LoadAdError) {
|
|
42
|
+
val adMobError = AdMobPluginError(adError)
|
|
43
|
+
|
|
44
|
+
notifyListenersFunction.accept(RewardInterstitialAdPluginEvents.FailedToLoad, adMobError)
|
|
45
|
+
call.reject(adError.message)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
package com.getcapacitor.community.admob.rewardedinterstitial.models
|
|
2
|
+
|
|
3
|
+
import com.getcapacitor.PluginCall
|
|
4
|
+
|
|
5
|
+
class SsvInfo(
|
|
6
|
+
val customData: String? = null,
|
|
7
|
+
val userId: String? = null) {
|
|
8
|
+
|
|
9
|
+
constructor(pluginCall: PluginCall?) : this(
|
|
10
|
+
pluginCall?.getObject("ssv")?.getString("customData"),
|
|
11
|
+
pluginCall?.getObject("ssv")?.getString("userId")
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
constructor() : this(null, null)
|
|
15
|
+
|
|
16
|
+
val hasInfo
|
|
17
|
+
get(): Boolean {
|
|
18
|
+
return customData != null || userId != null
|
|
19
|
+
}
|
|
20
|
+
}
|
package/dist/docs.json
CHANGED
|
@@ -1321,6 +1321,240 @@
|
|
|
1321
1321
|
"RewardAdPluginEvents"
|
|
1322
1322
|
],
|
|
1323
1323
|
"slug": "addlistenerrewardadplugineventsshowed-"
|
|
1324
|
+
},
|
|
1325
|
+
{
|
|
1326
|
+
"name": "prepareRewardInterstitialAd",
|
|
1327
|
+
"signature": "(options: RewardInterstitialAdOptions) => Promise<AdLoadInfo>",
|
|
1328
|
+
"parameters": [
|
|
1329
|
+
{
|
|
1330
|
+
"name": "options",
|
|
1331
|
+
"docs": "RewardAdOptions",
|
|
1332
|
+
"type": "RewardInterstitialAdOptions"
|
|
1333
|
+
}
|
|
1334
|
+
],
|
|
1335
|
+
"returns": "Promise<AdLoadInfo>",
|
|
1336
|
+
"tags": [
|
|
1337
|
+
{
|
|
1338
|
+
"name": "group",
|
|
1339
|
+
"text": [
|
|
1340
|
+
{
|
|
1341
|
+
"text": "RewardVideo",
|
|
1342
|
+
"kind": "text"
|
|
1343
|
+
}
|
|
1344
|
+
]
|
|
1345
|
+
},
|
|
1346
|
+
{
|
|
1347
|
+
"name": "param",
|
|
1348
|
+
"text": [
|
|
1349
|
+
{
|
|
1350
|
+
"text": "options",
|
|
1351
|
+
"kind": "parameterName"
|
|
1352
|
+
},
|
|
1353
|
+
{
|
|
1354
|
+
"text": " ",
|
|
1355
|
+
"kind": "space"
|
|
1356
|
+
},
|
|
1357
|
+
{
|
|
1358
|
+
"text": "RewardAdOptions",
|
|
1359
|
+
"kind": "text"
|
|
1360
|
+
}
|
|
1361
|
+
]
|
|
1362
|
+
},
|
|
1363
|
+
{
|
|
1364
|
+
"name": "since",
|
|
1365
|
+
"text": [
|
|
1366
|
+
{
|
|
1367
|
+
"text": "1.1.2",
|
|
1368
|
+
"kind": "text"
|
|
1369
|
+
}
|
|
1370
|
+
]
|
|
1371
|
+
}
|
|
1372
|
+
],
|
|
1373
|
+
"docs": "Prepare a reward video ad",
|
|
1374
|
+
"complexTypes": [
|
|
1375
|
+
"AdLoadInfo",
|
|
1376
|
+
"RewardInterstitialAdOptions"
|
|
1377
|
+
],
|
|
1378
|
+
"slug": "preparerewardinterstitialad"
|
|
1379
|
+
},
|
|
1380
|
+
{
|
|
1381
|
+
"name": "showRewardInterstitialAd",
|
|
1382
|
+
"signature": "() => Promise<AdMobRewardInterstitialItem>",
|
|
1383
|
+
"parameters": [],
|
|
1384
|
+
"returns": "Promise<AdMobRewardInterstitialItem>",
|
|
1385
|
+
"tags": [
|
|
1386
|
+
{
|
|
1387
|
+
"name": "group",
|
|
1388
|
+
"text": [
|
|
1389
|
+
{
|
|
1390
|
+
"text": "RewardVideo",
|
|
1391
|
+
"kind": "text"
|
|
1392
|
+
}
|
|
1393
|
+
]
|
|
1394
|
+
},
|
|
1395
|
+
{
|
|
1396
|
+
"name": "since",
|
|
1397
|
+
"text": [
|
|
1398
|
+
{
|
|
1399
|
+
"text": "1.1.2",
|
|
1400
|
+
"kind": "text"
|
|
1401
|
+
}
|
|
1402
|
+
]
|
|
1403
|
+
}
|
|
1404
|
+
],
|
|
1405
|
+
"docs": "Show a reward video ad",
|
|
1406
|
+
"complexTypes": [
|
|
1407
|
+
"AdMobRewardInterstitialItem"
|
|
1408
|
+
],
|
|
1409
|
+
"slug": "showrewardinterstitialad"
|
|
1410
|
+
},
|
|
1411
|
+
{
|
|
1412
|
+
"name": "addListener",
|
|
1413
|
+
"signature": "(eventName: RewardInterstitialAdPluginEvents.FailedToLoad, listenerFunc: (error: AdMobError) => void) => Promise<PluginListenerHandle>",
|
|
1414
|
+
"parameters": [
|
|
1415
|
+
{
|
|
1416
|
+
"name": "eventName",
|
|
1417
|
+
"docs": "",
|
|
1418
|
+
"type": "RewardInterstitialAdPluginEvents.FailedToLoad"
|
|
1419
|
+
},
|
|
1420
|
+
{
|
|
1421
|
+
"name": "listenerFunc",
|
|
1422
|
+
"docs": "",
|
|
1423
|
+
"type": "(error: AdMobError) => void"
|
|
1424
|
+
}
|
|
1425
|
+
],
|
|
1426
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
1427
|
+
"tags": [],
|
|
1428
|
+
"docs": "",
|
|
1429
|
+
"complexTypes": [
|
|
1430
|
+
"PluginListenerHandle",
|
|
1431
|
+
"RewardInterstitialAdPluginEvents",
|
|
1432
|
+
"AdMobError"
|
|
1433
|
+
],
|
|
1434
|
+
"slug": "addlistenerrewardinterstitialadplugineventsfailedtoload-"
|
|
1435
|
+
},
|
|
1436
|
+
{
|
|
1437
|
+
"name": "addListener",
|
|
1438
|
+
"signature": "(eventName: RewardInterstitialAdPluginEvents.Loaded, listenerFunc: (info: AdLoadInfo) => void) => Promise<PluginListenerHandle>",
|
|
1439
|
+
"parameters": [
|
|
1440
|
+
{
|
|
1441
|
+
"name": "eventName",
|
|
1442
|
+
"docs": "",
|
|
1443
|
+
"type": "RewardInterstitialAdPluginEvents.Loaded"
|
|
1444
|
+
},
|
|
1445
|
+
{
|
|
1446
|
+
"name": "listenerFunc",
|
|
1447
|
+
"docs": "",
|
|
1448
|
+
"type": "(info: AdLoadInfo) => void"
|
|
1449
|
+
}
|
|
1450
|
+
],
|
|
1451
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
1452
|
+
"tags": [],
|
|
1453
|
+
"docs": "",
|
|
1454
|
+
"complexTypes": [
|
|
1455
|
+
"PluginListenerHandle",
|
|
1456
|
+
"RewardInterstitialAdPluginEvents",
|
|
1457
|
+
"AdLoadInfo"
|
|
1458
|
+
],
|
|
1459
|
+
"slug": "addlistenerrewardinterstitialadplugineventsloaded-"
|
|
1460
|
+
},
|
|
1461
|
+
{
|
|
1462
|
+
"name": "addListener",
|
|
1463
|
+
"signature": "(eventName: RewardInterstitialAdPluginEvents.Rewarded, listenerFunc: (reward: AdMobRewardInterstitialItem) => void) => Promise<PluginListenerHandle>",
|
|
1464
|
+
"parameters": [
|
|
1465
|
+
{
|
|
1466
|
+
"name": "eventName",
|
|
1467
|
+
"docs": "",
|
|
1468
|
+
"type": "RewardInterstitialAdPluginEvents.Rewarded"
|
|
1469
|
+
},
|
|
1470
|
+
{
|
|
1471
|
+
"name": "listenerFunc",
|
|
1472
|
+
"docs": "",
|
|
1473
|
+
"type": "(reward: AdMobRewardInterstitialItem) => void"
|
|
1474
|
+
}
|
|
1475
|
+
],
|
|
1476
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
1477
|
+
"tags": [],
|
|
1478
|
+
"docs": "",
|
|
1479
|
+
"complexTypes": [
|
|
1480
|
+
"PluginListenerHandle",
|
|
1481
|
+
"RewardInterstitialAdPluginEvents",
|
|
1482
|
+
"AdMobRewardInterstitialItem"
|
|
1483
|
+
],
|
|
1484
|
+
"slug": "addlistenerrewardinterstitialadplugineventsrewarded-"
|
|
1485
|
+
},
|
|
1486
|
+
{
|
|
1487
|
+
"name": "addListener",
|
|
1488
|
+
"signature": "(eventName: RewardInterstitialAdPluginEvents.Dismissed, listenerFunc: () => void) => Promise<PluginListenerHandle>",
|
|
1489
|
+
"parameters": [
|
|
1490
|
+
{
|
|
1491
|
+
"name": "eventName",
|
|
1492
|
+
"docs": "",
|
|
1493
|
+
"type": "RewardInterstitialAdPluginEvents.Dismissed"
|
|
1494
|
+
},
|
|
1495
|
+
{
|
|
1496
|
+
"name": "listenerFunc",
|
|
1497
|
+
"docs": "",
|
|
1498
|
+
"type": "() => void"
|
|
1499
|
+
}
|
|
1500
|
+
],
|
|
1501
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
1502
|
+
"tags": [],
|
|
1503
|
+
"docs": "",
|
|
1504
|
+
"complexTypes": [
|
|
1505
|
+
"PluginListenerHandle",
|
|
1506
|
+
"RewardInterstitialAdPluginEvents"
|
|
1507
|
+
],
|
|
1508
|
+
"slug": "addlistenerrewardinterstitialadplugineventsdismissed-"
|
|
1509
|
+
},
|
|
1510
|
+
{
|
|
1511
|
+
"name": "addListener",
|
|
1512
|
+
"signature": "(eventName: RewardInterstitialAdPluginEvents.FailedToShow, listenerFunc: (error: AdMobError) => void) => Promise<PluginListenerHandle>",
|
|
1513
|
+
"parameters": [
|
|
1514
|
+
{
|
|
1515
|
+
"name": "eventName",
|
|
1516
|
+
"docs": "",
|
|
1517
|
+
"type": "RewardInterstitialAdPluginEvents.FailedToShow"
|
|
1518
|
+
},
|
|
1519
|
+
{
|
|
1520
|
+
"name": "listenerFunc",
|
|
1521
|
+
"docs": "",
|
|
1522
|
+
"type": "(error: AdMobError) => void"
|
|
1523
|
+
}
|
|
1524
|
+
],
|
|
1525
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
1526
|
+
"tags": [],
|
|
1527
|
+
"docs": "",
|
|
1528
|
+
"complexTypes": [
|
|
1529
|
+
"PluginListenerHandle",
|
|
1530
|
+
"RewardInterstitialAdPluginEvents",
|
|
1531
|
+
"AdMobError"
|
|
1532
|
+
],
|
|
1533
|
+
"slug": "addlistenerrewardinterstitialadplugineventsfailedtoshow-"
|
|
1534
|
+
},
|
|
1535
|
+
{
|
|
1536
|
+
"name": "addListener",
|
|
1537
|
+
"signature": "(eventName: RewardInterstitialAdPluginEvents.Showed, listenerFunc: () => void) => Promise<PluginListenerHandle>",
|
|
1538
|
+
"parameters": [
|
|
1539
|
+
{
|
|
1540
|
+
"name": "eventName",
|
|
1541
|
+
"docs": "",
|
|
1542
|
+
"type": "RewardInterstitialAdPluginEvents.Showed"
|
|
1543
|
+
},
|
|
1544
|
+
{
|
|
1545
|
+
"name": "listenerFunc",
|
|
1546
|
+
"docs": "",
|
|
1547
|
+
"type": "() => void"
|
|
1548
|
+
}
|
|
1549
|
+
],
|
|
1550
|
+
"returns": "Promise<PluginListenerHandle>",
|
|
1551
|
+
"tags": [],
|
|
1552
|
+
"docs": "",
|
|
1553
|
+
"complexTypes": [
|
|
1554
|
+
"PluginListenerHandle",
|
|
1555
|
+
"RewardInterstitialAdPluginEvents"
|
|
1556
|
+
],
|
|
1557
|
+
"slug": "addlistenerrewardinterstitialadplugineventsshowed-"
|
|
1324
1558
|
}
|
|
1325
1559
|
],
|
|
1326
1560
|
"properties": [],
|
|
@@ -1329,6 +1563,7 @@
|
|
|
1329
1563
|
"AdmobConsentDefinitions",
|
|
1330
1564
|
"InterstitialDefinitions",
|
|
1331
1565
|
"RewardDefinitions",
|
|
1566
|
+
"RewardInterstitialDefinitions",
|
|
1332
1567
|
"TrackingAuthorizationStatusInterface",
|
|
1333
1568
|
"AdMobDefinitions",
|
|
1334
1569
|
"AdMobInitializationOptions",
|
|
@@ -1516,6 +1751,7 @@
|
|
|
1516
1751
|
"AdmobConsentDefinitions",
|
|
1517
1752
|
"InterstitialDefinitions",
|
|
1518
1753
|
"RewardDefinitions",
|
|
1754
|
+
"RewardInterstitialDefinitions",
|
|
1519
1755
|
"TrackingAuthorizationStatusInterface",
|
|
1520
1756
|
"AdMobDefinitions",
|
|
1521
1757
|
"AdMobPlugin",
|
|
@@ -1594,6 +1830,7 @@
|
|
|
1594
1830
|
"AdmobConsentDefinitions",
|
|
1595
1831
|
"InterstitialDefinitions",
|
|
1596
1832
|
"RewardDefinitions",
|
|
1833
|
+
"RewardInterstitialDefinitions",
|
|
1597
1834
|
"TrackingAuthorizationStatusInterface",
|
|
1598
1835
|
"AdMobDefinitions",
|
|
1599
1836
|
"AdMobPlugin",
|
|
@@ -1645,6 +1882,7 @@
|
|
|
1645
1882
|
"AdmobConsentDefinitions",
|
|
1646
1883
|
"InterstitialDefinitions",
|
|
1647
1884
|
"RewardDefinitions",
|
|
1885
|
+
"RewardInterstitialDefinitions",
|
|
1648
1886
|
"TrackingAuthorizationStatusInterface",
|
|
1649
1887
|
"AdMobDefinitions",
|
|
1650
1888
|
"AdMobPlugin",
|
|
@@ -2141,6 +2379,66 @@
|
|
|
2141
2379
|
}
|
|
2142
2380
|
],
|
|
2143
2381
|
"importObject": []
|
|
2382
|
+
},
|
|
2383
|
+
{
|
|
2384
|
+
"name": "RewardInterstitialAdOptions",
|
|
2385
|
+
"slug": "rewardinterstitialadoptions",
|
|
2386
|
+
"docs": "",
|
|
2387
|
+
"tags": [],
|
|
2388
|
+
"methods": [],
|
|
2389
|
+
"properties": [
|
|
2390
|
+
{
|
|
2391
|
+
"name": "ssv",
|
|
2392
|
+
"tags": [
|
|
2393
|
+
{
|
|
2394
|
+
"text": [
|
|
2395
|
+
{
|
|
2396
|
+
"text": "https",
|
|
2397
|
+
"kind": "text"
|
|
2398
|
+
},
|
|
2399
|
+
{
|
|
2400
|
+
"text": "://support.google.com/admob/answer/9603226?hl=en-GB",
|
|
2401
|
+
"kind": "text"
|
|
2402
|
+
}
|
|
2403
|
+
],
|
|
2404
|
+
"name": "see"
|
|
2405
|
+
}
|
|
2406
|
+
],
|
|
2407
|
+
"docs": "If you have enabled SSV in your AdMob Application. You can provide customData or\na userId be passed to your callback to do further processing on.\n\n*Important* You *HAVE* to define one of them.",
|
|
2408
|
+
"complexTypes": [
|
|
2409
|
+
"AtLeastOne"
|
|
2410
|
+
],
|
|
2411
|
+
"type": "AtLeastOne<{\n /**\n * An optional UserId to pass to your SSV callback function.\n */\n userId: string;\n /**\n * An optional custom set of data to pass to your SSV callback function.\n */\n customData: string;\n }>"
|
|
2412
|
+
}
|
|
2413
|
+
],
|
|
2414
|
+
"importObject": [
|
|
2415
|
+
"AdOptions",
|
|
2416
|
+
"AtLeastOne"
|
|
2417
|
+
]
|
|
2418
|
+
},
|
|
2419
|
+
{
|
|
2420
|
+
"name": "AdMobRewardInterstitialItem",
|
|
2421
|
+
"slug": "admobrewardinterstitialitem",
|
|
2422
|
+
"docs": "For more information\nhttps://developers.google.com/admob/android/rewarded-video-adapters?hl=en",
|
|
2423
|
+
"tags": [],
|
|
2424
|
+
"methods": [],
|
|
2425
|
+
"properties": [
|
|
2426
|
+
{
|
|
2427
|
+
"name": "type",
|
|
2428
|
+
"tags": [],
|
|
2429
|
+
"docs": "Rewarded type user got",
|
|
2430
|
+
"complexTypes": [],
|
|
2431
|
+
"type": "string"
|
|
2432
|
+
},
|
|
2433
|
+
{
|
|
2434
|
+
"name": "amount",
|
|
2435
|
+
"tags": [],
|
|
2436
|
+
"docs": "Rewarded amount user got",
|
|
2437
|
+
"complexTypes": [],
|
|
2438
|
+
"type": "number"
|
|
2439
|
+
}
|
|
2440
|
+
],
|
|
2441
|
+
"importObject": []
|
|
2144
2442
|
}
|
|
2145
2443
|
],
|
|
2146
2444
|
"enums": [
|
|
@@ -2429,6 +2727,48 @@
|
|
|
2429
2727
|
"docs": "Emits when user get rewarded from AdReward"
|
|
2430
2728
|
}
|
|
2431
2729
|
]
|
|
2730
|
+
},
|
|
2731
|
+
{
|
|
2732
|
+
"name": "RewardInterstitialAdPluginEvents",
|
|
2733
|
+
"slug": "rewardinterstitialadpluginevents",
|
|
2734
|
+
"members": [
|
|
2735
|
+
{
|
|
2736
|
+
"name": "Loaded",
|
|
2737
|
+
"value": "'onRewardedInterstitialAdLoaded'",
|
|
2738
|
+
"tags": [],
|
|
2739
|
+
"docs": "Emits after trying to prepare a RewardAd and the Video is loaded and ready to be show"
|
|
2740
|
+
},
|
|
2741
|
+
{
|
|
2742
|
+
"name": "FailedToLoad",
|
|
2743
|
+
"value": "'onRewardedInterstitialAdFailedToLoad'",
|
|
2744
|
+
"tags": [],
|
|
2745
|
+
"docs": "Emits after trying to prepare a RewardAd when it could not be loaded"
|
|
2746
|
+
},
|
|
2747
|
+
{
|
|
2748
|
+
"name": "Showed",
|
|
2749
|
+
"value": "'onRewardedInterstitialAdShowed'",
|
|
2750
|
+
"tags": [],
|
|
2751
|
+
"docs": "Emits when the AdReward video is visible to the user"
|
|
2752
|
+
},
|
|
2753
|
+
{
|
|
2754
|
+
"name": "FailedToShow",
|
|
2755
|
+
"value": "'onRewardedInterstitialAdFailedToShow'",
|
|
2756
|
+
"tags": [],
|
|
2757
|
+
"docs": "Emits when the AdReward video is failed to show"
|
|
2758
|
+
},
|
|
2759
|
+
{
|
|
2760
|
+
"name": "Dismissed",
|
|
2761
|
+
"value": "'onRewardedInterstitialAdDismissed'",
|
|
2762
|
+
"tags": [],
|
|
2763
|
+
"docs": "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\nwill emits in this two cases:\n1. The user starts the video ad but close it before the reward emit.\n2. The user start the video and see it until end, then gets the reward\nand after that the ad is closed."
|
|
2764
|
+
},
|
|
2765
|
+
{
|
|
2766
|
+
"name": "Rewarded",
|
|
2767
|
+
"value": "'onRewardedInterstitialAdReward'",
|
|
2768
|
+
"tags": [],
|
|
2769
|
+
"docs": "Emits when user get rewarded from AdReward"
|
|
2770
|
+
}
|
|
2771
|
+
]
|
|
2432
2772
|
}
|
|
2433
2773
|
],
|
|
2434
2774
|
"typeAliases": [
|
|
@@ -2,8 +2,9 @@ import type { BannerDefinitions } from './banner';
|
|
|
2
2
|
import type { AdmobConsentDefinitions } from './consent';
|
|
3
3
|
import type { InterstitialDefinitions } from './interstitial';
|
|
4
4
|
import type { RewardDefinitions } from './reward';
|
|
5
|
+
import type { RewardInterstitialDefinitions } from './reward-interstitial';
|
|
5
6
|
import type { TrackingAuthorizationStatusInterface } from './shared/tracking-authorization-status.interface';
|
|
6
|
-
declare type AdMobDefinitions = BannerDefinitions & RewardDefinitions & InterstitialDefinitions & AdmobConsentDefinitions;
|
|
7
|
+
declare type AdMobDefinitions = BannerDefinitions & RewardDefinitions & RewardInterstitialDefinitions & InterstitialDefinitions & AdmobConsentDefinitions;
|
|
7
8
|
export interface AdMobPlugin extends AdMobDefinitions {
|
|
8
9
|
/**
|
|
9
10
|
* Initialize AdMob with AdMobInitializationOptions
|
|
@@ -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":"AAyGA,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/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ declare const AdMob: AdMobPlugin;
|
|
|
3
3
|
export * from './definitions';
|
|
4
4
|
export * from './banner/index';
|
|
5
5
|
export * from './interstitial/index';
|
|
6
|
+
export * from './reward-interstitial/index';
|
|
6
7
|
export * from './reward/index';
|
|
7
8
|
export * from './consent/index';
|
|
8
9
|
export * from './shared/index';
|
package/dist/esm/index.js
CHANGED
|
@@ -5,6 +5,7 @@ const AdMob = registerPlugin('AdMob', {
|
|
|
5
5
|
export * from './definitions';
|
|
6
6
|
export * from './banner/index';
|
|
7
7
|
export * from './interstitial/index';
|
|
8
|
+
export * from './reward-interstitial/index';
|
|
8
9
|
export * from './reward/index';
|
|
9
10
|
export * from './consent/index';
|
|
10
11
|
export * from './shared/index';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,KAAK,GAAG,cAAc,CAAc,OAAO,EAAE;IACjD,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;CACvD,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,KAAK,GAAG,cAAc,CAAc,OAAO,EAAE;IACjD,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;CACvD,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from './reward-interstitial-ad-plugin-events.enum';
|
|
2
|
+
export * from './reward-interstitial-definitions.interface';
|
|
3
|
+
export * from './reward-interstitial-item.interface';
|
|
4
|
+
export * from './reward-interstitial-ad-options.interface';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/reward-interstitial/index.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAC;AAC5D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,sCAAsC,CAAC;AACrD,cAAc,4CAA4C,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AdOptions } from '../shared/ad-options.interface';
|
|
2
|
+
declare type AtLeastOne<T> = {
|
|
3
|
+
[K in keyof T]: Pick<T, K>;
|
|
4
|
+
}[keyof T];
|
|
5
|
+
export interface RewardInterstitialAdOptions extends AdOptions {
|
|
6
|
+
/**
|
|
7
|
+
* If you have enabled SSV in your AdMob Application. You can provide customData or
|
|
8
|
+
* a userId be passed to your callback to do further processing on.
|
|
9
|
+
*
|
|
10
|
+
* *Important* You *HAVE* to define one of them.
|
|
11
|
+
*
|
|
12
|
+
* @see https://support.google.com/admob/answer/9603226?hl=en-GB
|
|
13
|
+
*/
|
|
14
|
+
ssv?: AtLeastOne<{
|
|
15
|
+
/**
|
|
16
|
+
* An optional UserId to pass to your SSV callback function.
|
|
17
|
+
*/
|
|
18
|
+
userId: string;
|
|
19
|
+
/**
|
|
20
|
+
* An optional custom set of data to pass to your SSV callback function.
|
|
21
|
+
*/
|
|
22
|
+
customData: string;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reward-interstitial-ad-options.interface.js","sourceRoot":"","sources":["../../../src/reward-interstitial/reward-interstitial-ad-options.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare enum RewardInterstitialAdPluginEvents {
|
|
2
|
+
/**
|
|
3
|
+
* Emits after trying to prepare a RewardAd and the Video is loaded and ready to be show
|
|
4
|
+
*/
|
|
5
|
+
Loaded = "onRewardedInterstitialAdLoaded",
|
|
6
|
+
/**
|
|
7
|
+
* Emits after trying to prepare a RewardAd when it could not be loaded
|
|
8
|
+
*/
|
|
9
|
+
FailedToLoad = "onRewardedInterstitialAdFailedToLoad",
|
|
10
|
+
/**
|
|
11
|
+
* Emits when the AdReward video is visible to the user
|
|
12
|
+
*/
|
|
13
|
+
Showed = "onRewardedInterstitialAdShowed",
|
|
14
|
+
/**
|
|
15
|
+
* Emits when the AdReward video is failed to show
|
|
16
|
+
*/
|
|
17
|
+
FailedToShow = "onRewardedInterstitialAdFailedToShow",
|
|
18
|
+
/**
|
|
19
|
+
* Emits when the AdReward video is not visible to the user anymore.
|
|
20
|
+
*
|
|
21
|
+
* **Important**: This has nothing to do with the reward it self. This event
|
|
22
|
+
* will emits in this two cases:
|
|
23
|
+
* 1. The user starts the video ad but close it before the reward emit.
|
|
24
|
+
* 2. The user start the video and see it until end, then gets the reward
|
|
25
|
+
* and after that the ad is closed.
|
|
26
|
+
*/
|
|
27
|
+
Dismissed = "onRewardedInterstitialAdDismissed",
|
|
28
|
+
/**
|
|
29
|
+
* Emits when user get rewarded from AdReward
|
|
30
|
+
*/
|
|
31
|
+
Rewarded = "onRewardedInterstitialAdReward"
|
|
32
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// This enum should be keep in sync with their native equivalents with the same name
|
|
2
|
+
export var RewardInterstitialAdPluginEvents;
|
|
3
|
+
(function (RewardInterstitialAdPluginEvents) {
|
|
4
|
+
/**
|
|
5
|
+
* Emits after trying to prepare a RewardAd and the Video is loaded and ready to be show
|
|
6
|
+
*/
|
|
7
|
+
RewardInterstitialAdPluginEvents["Loaded"] = "onRewardedInterstitialAdLoaded";
|
|
8
|
+
/**
|
|
9
|
+
* Emits after trying to prepare a RewardAd when it could not be loaded
|
|
10
|
+
*/
|
|
11
|
+
RewardInterstitialAdPluginEvents["FailedToLoad"] = "onRewardedInterstitialAdFailedToLoad";
|
|
12
|
+
/**
|
|
13
|
+
* Emits when the AdReward video is visible to the user
|
|
14
|
+
*/
|
|
15
|
+
RewardInterstitialAdPluginEvents["Showed"] = "onRewardedInterstitialAdShowed";
|
|
16
|
+
/**
|
|
17
|
+
* Emits when the AdReward video is failed to show
|
|
18
|
+
*/
|
|
19
|
+
RewardInterstitialAdPluginEvents["FailedToShow"] = "onRewardedInterstitialAdFailedToShow";
|
|
20
|
+
/**
|
|
21
|
+
* Emits when the AdReward video is not visible to the user anymore.
|
|
22
|
+
*
|
|
23
|
+
* **Important**: This has nothing to do with the reward it self. This event
|
|
24
|
+
* will emits in this two cases:
|
|
25
|
+
* 1. The user starts the video ad but close it before the reward emit.
|
|
26
|
+
* 2. The user start the video and see it until end, then gets the reward
|
|
27
|
+
* and after that the ad is closed.
|
|
28
|
+
*/
|
|
29
|
+
RewardInterstitialAdPluginEvents["Dismissed"] = "onRewardedInterstitialAdDismissed";
|
|
30
|
+
/**
|
|
31
|
+
* Emits when user get rewarded from AdReward
|
|
32
|
+
*/
|
|
33
|
+
RewardInterstitialAdPluginEvents["Rewarded"] = "onRewardedInterstitialAdReward";
|
|
34
|
+
})(RewardInterstitialAdPluginEvents || (RewardInterstitialAdPluginEvents = {}));
|
|
35
|
+
//# sourceMappingURL=reward-interstitial-ad-plugin-events.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reward-interstitial-ad-plugin-events.enum.js","sourceRoot":"","sources":["../../../src/reward-interstitial/reward-interstitial-ad-plugin-events.enum.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,MAAM,CAAN,IAAY,gCA+BX;AA/BD,WAAY,gCAAgC;IAC1C;;OAEG;IACH,6EAAyC,CAAA;IACzC;;OAEG;IACH,yFAAqD,CAAA;IACrD;;OAEG;IACH,6EAAyC,CAAA;IACzC;;OAEG;IACH,yFAAqD,CAAA;IACrD;;;;;;;;OAQG;IACH,mFAA+C,CAAA;IAC/C;;OAEG;IACH,+EAA2C,CAAA;AAC7C,CAAC,EA/BW,gCAAgC,KAAhC,gCAAgC,QA+B3C"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { PluginListenerHandle } from '@capacitor/core';
|
|
2
|
+
import type { ValidateAllEventsEnumAreImplemented } from '../private/validate-all-events-implemented.type';
|
|
3
|
+
import type { AdLoadInfo, AdMobError } from '../shared';
|
|
4
|
+
import type { RewardInterstitialAdOptions } from './reward-interstitial-ad-options.interface';
|
|
5
|
+
import type { RewardInterstitialAdPluginEvents } from './reward-interstitial-ad-plugin-events.enum';
|
|
6
|
+
import type { AdMobRewardInterstitialItem } from './reward-interstitial-item.interface';
|
|
7
|
+
export declare type RewardInterstitialDefinitionsHasAllEvents = ValidateAllEventsEnumAreImplemented<RewardInterstitialAdPluginEvents, RewardInterstitialDefinitions>;
|
|
8
|
+
export interface RewardInterstitialDefinitions {
|
|
9
|
+
/**
|
|
10
|
+
* Prepare a reward video ad
|
|
11
|
+
*
|
|
12
|
+
* @group RewardVideo
|
|
13
|
+
* @param options RewardAdOptions
|
|
14
|
+
* @since 1.1.2
|
|
15
|
+
*/
|
|
16
|
+
prepareRewardInterstitialAd(options: RewardInterstitialAdOptions): Promise<AdLoadInfo>;
|
|
17
|
+
/**
|
|
18
|
+
* Show a reward video ad
|
|
19
|
+
*
|
|
20
|
+
* @group RewardVideo
|
|
21
|
+
* @since 1.1.2
|
|
22
|
+
*/
|
|
23
|
+
showRewardInterstitialAd(): Promise<AdMobRewardInterstitialItem>;
|
|
24
|
+
addListener(eventName: RewardInterstitialAdPluginEvents.FailedToLoad, listenerFunc: (error: AdMobError) => void): Promise<PluginListenerHandle>;
|
|
25
|
+
addListener(eventName: RewardInterstitialAdPluginEvents.Loaded, listenerFunc: (info: AdLoadInfo) => void): Promise<PluginListenerHandle>;
|
|
26
|
+
addListener(eventName: RewardInterstitialAdPluginEvents.Rewarded, listenerFunc: (reward: AdMobRewardInterstitialItem) => void): Promise<PluginListenerHandle>;
|
|
27
|
+
addListener(eventName: RewardInterstitialAdPluginEvents.Dismissed, listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
28
|
+
addListener(eventName: RewardInterstitialAdPluginEvents.FailedToShow, listenerFunc: (error: AdMobError) => void): Promise<PluginListenerHandle>;
|
|
29
|
+
addListener(eventName: RewardInterstitialAdPluginEvents.Showed, listenerFunc: () => void): Promise<PluginListenerHandle>;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reward-interstitial-definitions.interface.js","sourceRoot":"","sources":["../../../src/reward-interstitial/reward-interstitial-definitions.interface.ts"],"names":[],"mappings":""}
|