@ququplay/admob 5.3.2 → 6.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.
@@ -15,5 +15,5 @@ Pod::Spec.new do |s|
15
15
  s.swift_version = '5.1'
16
16
  s.static_framework = true
17
17
  s.dependency 'Capacitor'
18
- s.dependency 'Google-Mobile-Ads-SDK', '10.12.0'
18
+ s.dependency 'Google-Mobile-Ads-SDK', '11.3.0'
19
19
  end
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/2023?style=flat-square" />
9
+ <img src="https://img.shields.io/maintenance/yes/2024?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>
@@ -151,7 +151,7 @@ export async function initialize(): Promise<void> {
151
151
  }
152
152
  ```
153
153
 
154
- Send and array of device Ids in `testingDevices? to use production like ads on your specified devices -> https://developers.google.com/admob/android/test-ads#enable_test_devices
154
+ Send an array of device Ids in `testingDevices` to use production like ads on your specified devices -> https://developers.google.com/admob/android/test-ads#enable_test_devices
155
155
 
156
156
  ### User Message Platform (UMP)
157
157
 
@@ -469,7 +469,7 @@ Destroy the banner, remove it from screen.
469
469
  ### addListener(BannerAdPluginEvents.SizeChanged, ...)
470
470
 
471
471
  ```typescript
472
- addListener(eventName: BannerAdPluginEvents.SizeChanged, listenerFunc: (info: AdMobBannerSize) => void) => PluginListenerHandle
472
+ addListener(eventName: BannerAdPluginEvents.SizeChanged, listenerFunc: (info: AdMobBannerSize) => void) => Promise<PluginListenerHandle>
473
473
  ```
474
474
 
475
475
  | Param | Type | Description |
@@ -477,7 +477,7 @@ addListener(eventName: BannerAdPluginEvents.SizeChanged, listenerFunc: (info: Ad
477
477
  | **`eventName`** | <code><a href="#banneradpluginevents">BannerAdPluginEvents.SizeChanged</a></code> | bannerAdSizeChanged |
478
478
  | **`listenerFunc`** | <code>(info: <a href="#admobbannersize">AdMobBannerSize</a>) =&gt; void</code> | |
479
479
 
480
- **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
480
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
481
481
 
482
482
  --------------------
483
483
 
@@ -485,7 +485,7 @@ addListener(eventName: BannerAdPluginEvents.SizeChanged, listenerFunc: (info: Ad
485
485
  ### addListener(BannerAdPluginEvents.Loaded, ...)
486
486
 
487
487
  ```typescript
488
- addListener(eventName: BannerAdPluginEvents.Loaded, listenerFunc: () => void) => PluginListenerHandle
488
+ addListener(eventName: BannerAdPluginEvents.Loaded, listenerFunc: () => void) => Promise<PluginListenerHandle>
489
489
  ```
490
490
 
491
491
  Notice: request loaded Banner ad
@@ -495,7 +495,7 @@ Notice: request loaded Banner ad
495
495
  | **`eventName`** | <code><a href="#banneradpluginevents">BannerAdPluginEvents.Loaded</a></code> | bannerAdLoaded |
496
496
  | **`listenerFunc`** | <code>() =&gt; void</code> | |
497
497
 
498
- **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
498
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
499
499
 
500
500
  --------------------
501
501
 
@@ -503,7 +503,7 @@ Notice: request loaded Banner ad
503
503
  ### addListener(BannerAdPluginEvents.FailedToLoad, ...)
504
504
 
505
505
  ```typescript
506
- addListener(eventName: BannerAdPluginEvents.FailedToLoad, listenerFunc: (info: AdMobError) => void) => PluginListenerHandle
506
+ addListener(eventName: BannerAdPluginEvents.FailedToLoad, listenerFunc: (info: AdMobError) => void) => Promise<PluginListenerHandle>
507
507
  ```
508
508
 
509
509
  Notice: request failed Banner ad
@@ -513,7 +513,7 @@ Notice: request failed Banner ad
513
513
  | **`eventName`** | <code><a href="#banneradpluginevents">BannerAdPluginEvents.FailedToLoad</a></code> | bannerAdFailedToLoad |
514
514
  | **`listenerFunc`** | <code>(info: <a href="#admoberror">AdMobError</a>) =&gt; void</code> | |
515
515
 
516
- **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
516
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
517
517
 
518
518
  --------------------
519
519
 
@@ -521,7 +521,7 @@ Notice: request failed Banner ad
521
521
  ### addListener(BannerAdPluginEvents.Opened, ...)
522
522
 
523
523
  ```typescript
524
- addListener(eventName: BannerAdPluginEvents.Opened, listenerFunc: () => void) => PluginListenerHandle
524
+ addListener(eventName: BannerAdPluginEvents.Opened, listenerFunc: () => void) => Promise<PluginListenerHandle>
525
525
  ```
526
526
 
527
527
  Notice: full-screen banner view will be presented in response to the user clicking on an ad.
@@ -531,7 +531,7 @@ Notice: full-screen banner view will be presented in response to the user clicki
531
531
  | **`eventName`** | <code><a href="#banneradpluginevents">BannerAdPluginEvents.Opened</a></code> | bannerAdOpened |
532
532
  | **`listenerFunc`** | <code>() =&gt; void</code> | |
533
533
 
534
- **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
534
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
535
535
 
536
536
  --------------------
537
537
 
@@ -539,7 +539,7 @@ Notice: full-screen banner view will be presented in response to the user clicki
539
539
  ### addListener(BannerAdPluginEvents.Closed, ...)
540
540
 
541
541
  ```typescript
542
- addListener(eventName: BannerAdPluginEvents.Closed, listenerFunc: () => void) => PluginListenerHandle
542
+ addListener(eventName: BannerAdPluginEvents.Closed, listenerFunc: () => void) => Promise<PluginListenerHandle>
543
543
  ```
544
544
 
545
545
  Notice: The full-screen banner view will been dismissed.
@@ -549,7 +549,7 @@ Notice: The full-screen banner view will been dismissed.
549
549
  | **`eventName`** | <code><a href="#banneradpluginevents">BannerAdPluginEvents.Closed</a></code> | bannerAdClosed |
550
550
  | **`listenerFunc`** | <code>() =&gt; void</code> | |
551
551
 
552
- **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
552
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
553
553
 
554
554
  --------------------
555
555
 
@@ -557,7 +557,7 @@ Notice: The full-screen banner view will been dismissed.
557
557
  ### addListener(BannerAdPluginEvents.AdImpression, ...)
558
558
 
559
559
  ```typescript
560
- addListener(eventName: BannerAdPluginEvents.AdImpression, listenerFunc: () => void) => PluginListenerHandle
560
+ addListener(eventName: BannerAdPluginEvents.AdImpression, listenerFunc: () => void) => Promise<PluginListenerHandle>
561
561
  ```
562
562
 
563
563
  Unimplemented
@@ -567,7 +567,7 @@ Unimplemented
567
567
  | **`eventName`** | <code><a href="#banneradpluginevents">BannerAdPluginEvents.AdImpression</a></code> | AdImpression |
568
568
  | **`listenerFunc`** | <code>() =&gt; void</code> | |
569
569
 
570
- **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
570
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
571
571
 
572
572
  --------------------
573
573
 
@@ -644,7 +644,7 @@ Show interstitial ad when it’s ready
644
644
  ### addListener(InterstitialAdPluginEvents.FailedToLoad, ...)
645
645
 
646
646
  ```typescript
647
- addListener(eventName: InterstitialAdPluginEvents.FailedToLoad, listenerFunc: (error: AdMobError) => void) => PluginListenerHandle
647
+ addListener(eventName: InterstitialAdPluginEvents.FailedToLoad, listenerFunc: (error: AdMobError) => void) => Promise<PluginListenerHandle>
648
648
  ```
649
649
 
650
650
  | Param | Type |
@@ -652,7 +652,7 @@ addListener(eventName: InterstitialAdPluginEvents.FailedToLoad, listenerFunc: (e
652
652
  | **`eventName`** | <code><a href="#interstitialadpluginevents">InterstitialAdPluginEvents.FailedToLoad</a></code> |
653
653
  | **`listenerFunc`** | <code>(error: <a href="#admoberror">AdMobError</a>) =&gt; void</code> |
654
654
 
655
- **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
655
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
656
656
 
657
657
  --------------------
658
658
 
@@ -660,7 +660,7 @@ addListener(eventName: InterstitialAdPluginEvents.FailedToLoad, listenerFunc: (e
660
660
  ### addListener(InterstitialAdPluginEvents.Loaded, ...)
661
661
 
662
662
  ```typescript
663
- addListener(eventName: InterstitialAdPluginEvents.Loaded, listenerFunc: (info: AdLoadInfo) => void) => PluginListenerHandle
663
+ addListener(eventName: InterstitialAdPluginEvents.Loaded, listenerFunc: (info: AdLoadInfo) => void) => Promise<PluginListenerHandle>
664
664
  ```
665
665
 
666
666
  | Param | Type |
@@ -668,7 +668,7 @@ addListener(eventName: InterstitialAdPluginEvents.Loaded, listenerFunc: (info: A
668
668
  | **`eventName`** | <code><a href="#interstitialadpluginevents">InterstitialAdPluginEvents.Loaded</a></code> |
669
669
  | **`listenerFunc`** | <code>(info: <a href="#adloadinfo">AdLoadInfo</a>) =&gt; void</code> |
670
670
 
671
- **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
671
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
672
672
 
673
673
  --------------------
674
674
 
@@ -676,7 +676,7 @@ addListener(eventName: InterstitialAdPluginEvents.Loaded, listenerFunc: (info: A
676
676
  ### addListener(InterstitialAdPluginEvents.Dismissed, ...)
677
677
 
678
678
  ```typescript
679
- addListener(eventName: InterstitialAdPluginEvents.Dismissed, listenerFunc: () => void) => PluginListenerHandle
679
+ addListener(eventName: InterstitialAdPluginEvents.Dismissed, listenerFunc: () => void) => Promise<PluginListenerHandle>
680
680
  ```
681
681
 
682
682
  | Param | Type |
@@ -684,7 +684,7 @@ addListener(eventName: InterstitialAdPluginEvents.Dismissed, listenerFunc: () =>
684
684
  | **`eventName`** | <code><a href="#interstitialadpluginevents">InterstitialAdPluginEvents.Dismissed</a></code> |
685
685
  | **`listenerFunc`** | <code>() =&gt; void</code> |
686
686
 
687
- **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
687
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
688
688
 
689
689
  --------------------
690
690
 
@@ -692,7 +692,7 @@ addListener(eventName: InterstitialAdPluginEvents.Dismissed, listenerFunc: () =>
692
692
  ### addListener(InterstitialAdPluginEvents.FailedToShow, ...)
693
693
 
694
694
  ```typescript
695
- addListener(eventName: InterstitialAdPluginEvents.FailedToShow, listenerFunc: (error: AdMobError) => void) => PluginListenerHandle
695
+ addListener(eventName: InterstitialAdPluginEvents.FailedToShow, listenerFunc: (error: AdMobError) => void) => Promise<PluginListenerHandle>
696
696
  ```
697
697
 
698
698
  | Param | Type |
@@ -700,7 +700,7 @@ addListener(eventName: InterstitialAdPluginEvents.FailedToShow, listenerFunc: (e
700
700
  | **`eventName`** | <code><a href="#interstitialadpluginevents">InterstitialAdPluginEvents.FailedToShow</a></code> |
701
701
  | **`listenerFunc`** | <code>(error: <a href="#admoberror">AdMobError</a>) =&gt; void</code> |
702
702
 
703
- **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
703
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
704
704
 
705
705
  --------------------
706
706
 
@@ -708,7 +708,7 @@ addListener(eventName: InterstitialAdPluginEvents.FailedToShow, listenerFunc: (e
708
708
  ### addListener(InterstitialAdPluginEvents.Showed, ...)
709
709
 
710
710
  ```typescript
711
- addListener(eventName: InterstitialAdPluginEvents.Showed, listenerFunc: () => void) => PluginListenerHandle
711
+ addListener(eventName: InterstitialAdPluginEvents.Showed, listenerFunc: () => void) => Promise<PluginListenerHandle>
712
712
  ```
713
713
 
714
714
  | Param | Type |
@@ -716,7 +716,7 @@ addListener(eventName: InterstitialAdPluginEvents.Showed, listenerFunc: () => vo
716
716
  | **`eventName`** | <code><a href="#interstitialadpluginevents">InterstitialAdPluginEvents.Showed</a></code> |
717
717
  | **`listenerFunc`** | <code>() =&gt; void</code> |
718
718
 
719
- **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
719
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
720
720
 
721
721
  --------------------
722
722
 
@@ -754,7 +754,7 @@ Show a reward video ad
754
754
  ### addListener(RewardAdPluginEvents.FailedToLoad, ...)
755
755
 
756
756
  ```typescript
757
- addListener(eventName: RewardAdPluginEvents.FailedToLoad, listenerFunc: (error: AdMobError) => void) => PluginListenerHandle
757
+ addListener(eventName: RewardAdPluginEvents.FailedToLoad, listenerFunc: (error: AdMobError) => void) => Promise<PluginListenerHandle>
758
758
  ```
759
759
 
760
760
  | Param | Type |
@@ -762,7 +762,7 @@ addListener(eventName: RewardAdPluginEvents.FailedToLoad, listenerFunc: (error:
762
762
  | **`eventName`** | <code><a href="#rewardadpluginevents">RewardAdPluginEvents.FailedToLoad</a></code> |
763
763
  | **`listenerFunc`** | <code>(error: <a href="#admoberror">AdMobError</a>) =&gt; void</code> |
764
764
 
765
- **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
765
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
766
766
 
767
767
  --------------------
768
768
 
@@ -770,7 +770,7 @@ addListener(eventName: RewardAdPluginEvents.FailedToLoad, listenerFunc: (error:
770
770
  ### addListener(RewardAdPluginEvents.Loaded, ...)
771
771
 
772
772
  ```typescript
773
- addListener(eventName: RewardAdPluginEvents.Loaded, listenerFunc: (info: AdLoadInfo) => void) => PluginListenerHandle
773
+ addListener(eventName: RewardAdPluginEvents.Loaded, listenerFunc: (info: AdLoadInfo) => void) => Promise<PluginListenerHandle>
774
774
  ```
775
775
 
776
776
  | Param | Type |
@@ -778,7 +778,7 @@ addListener(eventName: RewardAdPluginEvents.Loaded, listenerFunc: (info: AdLoadI
778
778
  | **`eventName`** | <code><a href="#rewardadpluginevents">RewardAdPluginEvents.Loaded</a></code> |
779
779
  | **`listenerFunc`** | <code>(info: <a href="#adloadinfo">AdLoadInfo</a>) =&gt; void</code> |
780
780
 
781
- **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
781
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
782
782
 
783
783
  --------------------
784
784
 
@@ -786,7 +786,7 @@ addListener(eventName: RewardAdPluginEvents.Loaded, listenerFunc: (info: AdLoadI
786
786
  ### addListener(RewardAdPluginEvents.Rewarded, ...)
787
787
 
788
788
  ```typescript
789
- addListener(eventName: RewardAdPluginEvents.Rewarded, listenerFunc: (reward: AdMobRewardItem) => void) => PluginListenerHandle
789
+ addListener(eventName: RewardAdPluginEvents.Rewarded, listenerFunc: (reward: AdMobRewardItem) => void) => Promise<PluginListenerHandle>
790
790
  ```
791
791
 
792
792
  | Param | Type |
@@ -794,7 +794,7 @@ addListener(eventName: RewardAdPluginEvents.Rewarded, listenerFunc: (reward: AdM
794
794
  | **`eventName`** | <code><a href="#rewardadpluginevents">RewardAdPluginEvents.Rewarded</a></code> |
795
795
  | **`listenerFunc`** | <code>(reward: <a href="#admobrewarditem">AdMobRewardItem</a>) =&gt; void</code> |
796
796
 
797
- **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
797
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
798
798
 
799
799
  --------------------
800
800
 
@@ -802,7 +802,7 @@ addListener(eventName: RewardAdPluginEvents.Rewarded, listenerFunc: (reward: AdM
802
802
  ### addListener(RewardAdPluginEvents.Dismissed, ...)
803
803
 
804
804
  ```typescript
805
- addListener(eventName: RewardAdPluginEvents.Dismissed, listenerFunc: () => void) => PluginListenerHandle
805
+ addListener(eventName: RewardAdPluginEvents.Dismissed, listenerFunc: () => void) => Promise<PluginListenerHandle>
806
806
  ```
807
807
 
808
808
  | Param | Type |
@@ -810,7 +810,7 @@ addListener(eventName: RewardAdPluginEvents.Dismissed, listenerFunc: () => void)
810
810
  | **`eventName`** | <code><a href="#rewardadpluginevents">RewardAdPluginEvents.Dismissed</a></code> |
811
811
  | **`listenerFunc`** | <code>() =&gt; void</code> |
812
812
 
813
- **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
813
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
814
814
 
815
815
  --------------------
816
816
 
@@ -818,7 +818,7 @@ addListener(eventName: RewardAdPluginEvents.Dismissed, listenerFunc: () => void)
818
818
  ### addListener(RewardAdPluginEvents.FailedToShow, ...)
819
819
 
820
820
  ```typescript
821
- addListener(eventName: RewardAdPluginEvents.FailedToShow, listenerFunc: (error: AdMobError) => void) => PluginListenerHandle
821
+ addListener(eventName: RewardAdPluginEvents.FailedToShow, listenerFunc: (error: AdMobError) => void) => Promise<PluginListenerHandle>
822
822
  ```
823
823
 
824
824
  | Param | Type |
@@ -826,7 +826,7 @@ addListener(eventName: RewardAdPluginEvents.FailedToShow, listenerFunc: (error:
826
826
  | **`eventName`** | <code><a href="#rewardadpluginevents">RewardAdPluginEvents.FailedToShow</a></code> |
827
827
  | **`listenerFunc`** | <code>(error: <a href="#admoberror">AdMobError</a>) =&gt; void</code> |
828
828
 
829
- **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
829
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
830
830
 
831
831
  --------------------
832
832
 
@@ -834,7 +834,7 @@ addListener(eventName: RewardAdPluginEvents.FailedToShow, listenerFunc: (error:
834
834
  ### addListener(RewardAdPluginEvents.Showed, ...)
835
835
 
836
836
  ```typescript
837
- addListener(eventName: RewardAdPluginEvents.Showed, listenerFunc: () => void) => PluginListenerHandle
837
+ addListener(eventName: RewardAdPluginEvents.Showed, listenerFunc: () => void) => Promise<PluginListenerHandle>
838
838
  ```
839
839
 
840
840
  | Param | Type |
@@ -842,7 +842,7 @@ addListener(eventName: RewardAdPluginEvents.Showed, listenerFunc: () => void) =>
842
842
  | **`eventName`** | <code><a href="#rewardadpluginevents">RewardAdPluginEvents.Showed</a></code> |
843
843
  | **`listenerFunc`** | <code>() =&gt; void</code> |
844
844
 
845
- **Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
845
+ **Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>
846
846
 
847
847
  --------------------
848
848
 
@@ -4,18 +4,18 @@ ext {
4
4
  androidxCoordinatorLayoutVersion = project.hasProperty('androidxCoordinatorLayoutVersion') ? rootProject.ext.androidxCoordinatorLayoutVersion : '1.2.0'
5
5
  androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
6
6
  androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
7
- playServicesAdsVersion = project.hasProperty('playServicesAdsVersion') ? rootProject.ext.playServicesAdsVersion : '22.4.0'
8
- androidxCoreKTXVersion = project.hasProperty('androidxCoreKTXVersion') ? rootProject.ext.androidxCoreKTXVersion : '1.10.0'
7
+ playServicesAdsVersion = project.hasProperty('playServicesAdsVersion') ? rootProject.ext.playServicesAdsVersion : '23.0.0'
8
+ androidxCoreKTXVersion = project.hasProperty('androidxCoreKTXVersion') ? rootProject.ext.androidxCoreKTXVersion : '1.13.0'
9
9
  }
10
10
 
11
11
  buildscript {
12
- ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '1.8.20'
12
+ ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '1.9.10'
13
13
  repositories {
14
14
  google()
15
15
  mavenCentral()
16
16
  }
17
17
  dependencies {
18
- classpath 'com.android.tools.build:gradle:8.0.0'
18
+ classpath 'com.android.tools.build:gradle:8.2.1'
19
19
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
20
20
  }
21
21
  }
@@ -25,10 +25,10 @@ apply plugin: 'kotlin-android'
25
25
 
26
26
  android {
27
27
  namespace "com.getcapacitor.community.admob.admob"
28
- compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
28
+ compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
29
29
  defaultConfig {
30
30
  minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
31
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 33
31
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
32
32
  versionCode 1
33
33
  versionName "1.0"
34
34
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -5,7 +5,6 @@ import android.content.Context;
5
5
  import android.content.SharedPreferences;
6
6
  import android.preference.PreferenceManager;
7
7
  import android.util.Log;
8
-
9
8
  import androidx.core.util.Supplier;
10
9
  import com.getcapacitor.JSArray;
11
10
  import com.getcapacitor.JSObject;
@@ -19,7 +18,6 @@ import com.google.android.ump.ConsentInformation;
19
18
  import com.google.android.ump.ConsentRequestParameters;
20
19
  import com.google.android.ump.FormError;
21
20
  import com.google.android.ump.UserMessagingPlatform;
22
-
23
21
  import java.util.ArrayList;
24
22
  import java.util.List;
25
23
 
@@ -36,13 +34,13 @@ public class AdConsentExecutor extends Executor {
36
34
  super(contextSupplier, activitySupplier, notifyListenersFunction, pluginLogTag, "AdConsentExecutor");
37
35
  }
38
36
 
39
- public boolean canShowPersonalizedAds(){
37
+ public boolean canShowPersonalizedAds() {
40
38
  Context context = contextSupplier.get();
41
39
  SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext());
42
40
  String purposeConsent = prefs.getString("IABTCF_PurposeConsents", "");
43
- String vendorConsent = prefs.getString("IABTCF_VendorConsents","");
44
- String vendorLI = prefs.getString("IABTCF_VendorLegitimateInterests","");
45
- String purposeLI = prefs.getString("IABTCF_PurposeLegitimateInterests","");
41
+ String vendorConsent = prefs.getString("IABTCF_VendorConsents", "");
42
+ String vendorLI = prefs.getString("IABTCF_VendorLegitimateInterests", "");
43
+ String purposeLI = prefs.getString("IABTCF_PurposeLegitimateInterests", "");
46
44
 
47
45
  int googleId = 755;
48
46
  boolean hasGoogleVendorConsent = hasAttribute(vendorConsent, googleId);
@@ -59,17 +57,19 @@ public class AdConsentExecutor extends Executor {
59
57
  indexesLI.add(9);
60
58
  indexesLI.add(10);
61
59
 
62
- return hasConsentFor(indexes, purposeConsent, hasGoogleVendorConsent)
63
- && hasConsentOrLegitimateInterestFor(indexesLI, purposeConsent, purposeLI, hasGoogleVendorConsent, hasGoogleVendorLI);
64
-
60
+ return (
61
+ hasConsentFor(indexes, purposeConsent, hasGoogleVendorConsent) &&
62
+ hasConsentOrLegitimateInterestFor(indexesLI, purposeConsent, purposeLI, hasGoogleVendorConsent, hasGoogleVendorLI)
63
+ );
65
64
  }
66
- public boolean canShowAds(){
65
+
66
+ public boolean canShowAds() {
67
67
  Context context = contextSupplier.get();
68
68
  SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext());
69
69
  String purposeConsent = prefs.getString("IABTCF_PurposeConsents", "");
70
- String vendorConsent = prefs.getString("IABTCF_VendorConsents","");
71
- String vendorLI = prefs.getString("IABTCF_VendorLegitimateInterests","");
72
- String purposeLI = prefs.getString("IABTCF_PurposeLegitimateInterests","");
70
+ String vendorConsent = prefs.getString("IABTCF_VendorConsents", "");
71
+ String vendorLI = prefs.getString("IABTCF_VendorLegitimateInterests", "");
72
+ String purposeLI = prefs.getString("IABTCF_PurposeLegitimateInterests", "");
73
73
 
74
74
  int googleId = 755;
75
75
  boolean hasGoogleVendorConsent = hasAttribute(vendorConsent, googleId);
@@ -84,9 +84,10 @@ public class AdConsentExecutor extends Executor {
84
84
  indexesLI.add(9);
85
85
  indexesLI.add(10);
86
86
 
87
- return hasConsentFor(indexes, purposeConsent, hasGoogleVendorConsent)
88
- && hasConsentOrLegitimateInterestFor(indexesLI, purposeConsent, purposeLI, hasGoogleVendorConsent, hasGoogleVendorLI);
89
-
87
+ return (
88
+ hasConsentFor(indexes, purposeConsent, hasGoogleVendorConsent) &&
89
+ hasConsentOrLegitimateInterestFor(indexesLI, purposeConsent, purposeLI, hasGoogleVendorConsent, hasGoogleVendorLI)
90
+ );
90
91
  }
91
92
 
92
93
  @PluginMethod
@@ -206,11 +207,11 @@ public class AdConsentExecutor extends Executor {
206
207
 
207
208
  private boolean hasAttribute(String input, int index) {
208
209
  if (input == null) return false;
209
- return input.length() >= index && input.charAt(index-1) == '1';
210
+ return input.length() >= index && input.charAt(index - 1) == '1';
210
211
  }
211
212
 
212
213
  private boolean hasConsentFor(List<Integer> indexes, String purposeConsent, boolean hasVendorConsent) {
213
- for (Integer p: indexes) {
214
+ for (Integer p : indexes) {
214
215
  if (!hasAttribute(purposeConsent, p)) {
215
216
  return false;
216
217
  }
@@ -218,12 +219,18 @@ public class AdConsentExecutor extends Executor {
218
219
  return hasVendorConsent;
219
220
  }
220
221
 
221
- private boolean hasConsentOrLegitimateInterestFor(List<Integer> indexes, String purposeConsent, String purposeLI, boolean hasVendorConsent, boolean hasVendorLI){
222
- for (Integer p: indexes) {
222
+ private boolean hasConsentOrLegitimateInterestFor(
223
+ List<Integer> indexes,
224
+ String purposeConsent,
225
+ String purposeLI,
226
+ boolean hasVendorConsent,
227
+ boolean hasVendorLI
228
+ ) {
229
+ for (Integer p : indexes) {
223
230
  boolean purposeAndVendorLI = hasAttribute(purposeLI, p) && hasVendorLI;
224
231
  boolean purposeConsentAndVendorConsent = hasAttribute(purposeConsent, p) && hasVendorConsent;
225
232
  boolean isOk = purposeAndVendorLI || purposeConsentAndVendorConsent;
226
- if (!isOk){
233
+ if (!isOk) {
227
234
  return false;
228
235
  }
229
236
  }