@capacitor-community/admob 7.1.0-0 → 7.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.
Files changed (35) hide show
  1. package/CapacitorCommunityAdmob.podspec +1 -1
  2. package/Package.swift +4 -2
  3. package/README.md +415 -376
  4. package/android/build.gradle +15 -14
  5. package/android/src/main/java/com/getcapacitor/community/admob/AdMob.java +5 -0
  6. package/android/src/main/java/com/getcapacitor/community/admob/banner/BannerExecutor.java +17 -14
  7. package/android/src/main/java/com/getcapacitor/community/admob/consent/AdConsentExecutor.java +42 -24
  8. package/android/src/main/java/com/getcapacitor/community/admob/interstitial/AdInterstitialExecutor.java +1 -1
  9. package/android/src/main/java/com/getcapacitor/community/admob/interstitial/InterstitialAdCallbackAndListeners.kt +2 -0
  10. package/android/src/main/java/com/getcapacitor/community/admob/rewarded/AdRewardExecutor.java +1 -1
  11. package/android/src/main/java/com/getcapacitor/community/admob/rewarded/RewardedAdCallbackAndListeners.kt +3 -0
  12. package/android/src/main/java/com/getcapacitor/community/admob/rewardedinterstitial/AdRewardInterstitialExecutor.java +1 -1
  13. package/dist/docs.json +175 -10
  14. package/dist/esm/consent/consent-debug-geography.enum.d.ts +10 -1
  15. package/dist/esm/consent/consent-debug-geography.enum.js +9 -0
  16. package/dist/esm/consent/consent-debug-geography.enum.js.map +1 -1
  17. package/dist/esm/consent/consent-definition.interface.d.ts +7 -0
  18. package/dist/esm/consent/consent-info.interface.d.ts +11 -0
  19. package/dist/esm/consent/privacy-options-requirement-status.enum.d.ts +19 -0
  20. package/dist/esm/consent/privacy-options-requirement-status.enum.js +21 -0
  21. package/dist/esm/consent/privacy-options-requirement-status.enum.js.map +1 -0
  22. package/dist/esm/definitions.d.ts +0 -1
  23. package/dist/esm/definitions.js.map +1 -1
  24. package/dist/esm/shared/ad-options.interface.d.ts +11 -0
  25. package/dist/esm/web.d.ts +1 -0
  26. package/dist/esm/web.js +8 -0
  27. package/dist/esm/web.js.map +1 -1
  28. package/dist/plugin.cjs.js +37 -0
  29. package/dist/plugin.cjs.js.map +1 -1
  30. package/dist/plugin.js +37 -0
  31. package/dist/plugin.js.map +1 -1
  32. package/ios/Sources/AdMobPlugin/AdMobPlugin.swift +7 -0
  33. package/ios/Sources/AdMobPlugin/Banner/BannerExecutor.swift +8 -27
  34. package/ios/Sources/AdMobPlugin/Consent/ConsentExecutor.swift +39 -20
  35. package/package.json +1 -1
@@ -1,15 +1,16 @@
1
1
  ext {
2
2
  junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3
- androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
4
- androidxCoordinatorLayoutVersion = project.hasProperty('androidxCoordinatorLayoutVersion') ? rootProject.ext.androidxCoordinatorLayoutVersion : '1.2.0'
3
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
4
+ androidxCoordinatorLayoutVersion = project.hasProperty('androidxCoordinatorLayoutVersion') ? rootProject.ext.androidxCoordinatorLayoutVersion : '1.3.0'
5
5
  androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
6
6
  androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
7
- playServicesAdsVersion = project.hasProperty('playServicesAdsVersion') ? rootProject.ext.playServicesAdsVersion : '24.4.+'
8
- androidxCoreKTXVersion = project.hasProperty('androidxCoreKTXVersion') ? rootProject.ext.androidxCoreKTXVersion : '1.13.0'
7
+ playServicesAdsVersion = project.hasProperty('playServicesAdsVersion') ? rootProject.ext.playServicesAdsVersion : '24.7.+'
8
+ userMessagingPlatformVersion = project.hasProperty('userMessagingPlatformVersion') ? rootProject.ext.userMessagingPlatformVersion : '3.1.0'
9
+ androidxCoreKTXVersion = project.hasProperty('androidxCoreKTXVersion') ? rootProject.ext.androidxCoreKTXVersion : '1.15.0'
9
10
  }
10
11
 
11
12
  buildscript {
12
- ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '2.1.0'
13
+ ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '2.1.20'
13
14
  repositories {
14
15
  google()
15
16
  mavenCentral()
@@ -57,29 +58,29 @@ repositories {
57
58
 
58
59
  }
59
60
 
60
- def testRunner = "1.4.0"
61
+ def testRunner = "1.7.0"
61
62
 
62
63
  dependencies {
63
64
  implementation fileTree(dir: 'libs', include: ['*.jar'])
64
65
  implementation project(':capacitor-android')
65
66
 
66
- testImplementation 'org.mockito:mockito-inline:3.6.28'
67
- testImplementation 'org.mockito:mockito-junit-jupiter:2.27.0'
68
- testImplementation "org.junit.jupiter:junit-jupiter-api:5.3.2"
67
+ testImplementation 'org.mockito:mockito-inline:5.2.0'
68
+ testImplementation 'org.mockito:mockito-junit-jupiter:5.15.2'
69
+ testImplementation "org.junit.jupiter:junit-jupiter-api:5.11.4"
69
70
  // https://medium.com/google-developer-experts/pushing-the-limits-of-androidx-test-3776ff249c71
70
71
  testImplementation "androidx.test:core:$testRunner"
71
72
  testImplementation "androidx.test:runner:$testRunner"
72
73
 
73
- testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.3.2"
74
- testImplementation "org.junit.jupiter:junit-jupiter-params:5.3.2"
75
- testRuntimeOnly "org.junit.vintage:junit-vintage-engine:5.3.2"
76
- testImplementation 'org.json:json:20200518'
74
+ testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.11.4"
75
+ testImplementation "org.junit.jupiter:junit-jupiter-params:5.11.4"
76
+ testRuntimeOnly "org.junit.vintage:junit-vintage-engine:5.11.4"
77
+ testImplementation 'org.json:json:20231013'
77
78
  // We do not need expresso tests here... or?
78
79
  // androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
79
80
  // androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
80
81
 
81
- // after 20.5.0, require minCompileSdk (31)
82
82
  implementation "com.google.android.gms:play-services-ads:$playServicesAdsVersion"
83
+ implementation "com.google.android.ump:user-messaging-platform:$userMessagingPlatformVersion"
83
84
  implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
84
85
  implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
85
86
  implementation "androidx.core:core-ktx:$androidxCoreKTXVersion"
@@ -99,6 +99,11 @@ public class AdMob extends Plugin {
99
99
  adConsentExecutor.requestConsentInfo(call, this::notifyListeners);
100
100
  }
101
101
 
102
+ @PluginMethod
103
+ public void showPrivacyOptionsForm(final PluginCall call) {
104
+ adConsentExecutor.showPrivacyOptionsForm(call, this::notifyListeners);
105
+ }
106
+
102
107
  @PluginMethod
103
108
  public void showConsentForm(final PluginCall call) {
104
109
  adConsentExecutor.showConsentForm(call, this::notifyListeners);
@@ -2,6 +2,7 @@ package com.getcapacitor.community.admob.banner;
2
2
 
3
3
  import android.app.Activity;
4
4
  import android.content.Context;
5
+ import android.os.Build;
5
6
  import android.util.DisplayMetrics;
6
7
  import android.util.Log;
7
8
  import android.view.Gravity;
@@ -102,21 +103,23 @@ public class BannerExecutor extends Executor {
102
103
  break;
103
104
  }
104
105
 
105
- // set Safe Area
106
- View rootView = activitySupplier.get().getWindow().getDecorView();
107
- rootView.setOnApplyWindowInsetsListener((v, insets) -> {
108
- int bottomInset = insets.getSystemWindowInsetBottom();
109
- int topInset = insets.getSystemWindowInsetTop();
110
-
111
- if ("TOP_CENTER".equals(adOptions.position)) {
112
- mAdViewLayoutParams.setMargins(0, topInset, 0, 0);
113
- } else {
114
- mAdViewLayoutParams.setMargins(0, 0, 0, bottomInset);
115
- }
106
+ // set Safe Area only for Android 15+
107
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
108
+ View rootView = activitySupplier.get().getWindow().getDecorView();
109
+ rootView.setOnApplyWindowInsetsListener((v, insets) -> {
110
+ int bottomInset = insets.getSystemWindowInsetBottom();
111
+ int topInset = insets.getSystemWindowInsetTop();
112
+
113
+ if ("TOP_CENTER".equals(adOptions.position)) {
114
+ mAdViewLayoutParams.setMargins(0, topInset, 0, 0);
115
+ } else {
116
+ mAdViewLayoutParams.setMargins(0, 0, 0, bottomInset);
117
+ }
116
118
 
117
- mAdViewLayout.setLayoutParams(mAdViewLayoutParams);
118
- return insets;
119
- });
119
+ mAdViewLayout.setLayoutParams(mAdViewLayoutParams);
120
+ return insets;
121
+ });
122
+ }
120
123
 
121
124
  mAdViewLayout.setLayoutParams(mAdViewLayoutParams);
122
125
 
@@ -2,8 +2,6 @@ package com.getcapacitor.community.admob.consent;
2
2
 
3
3
  import android.app.Activity;
4
4
  import android.content.Context;
5
- import android.content.SharedPreferences;
6
- import android.preference.PreferenceManager;
7
5
  import androidx.core.util.Supplier;
8
6
  import com.getcapacitor.JSArray;
9
7
  import com.getcapacitor.JSObject;
@@ -12,10 +10,8 @@ import com.getcapacitor.PluginMethod;
12
10
  import com.getcapacitor.community.admob.models.Executor;
13
11
  import com.google.android.gms.common.util.BiConsumer;
14
12
  import com.google.android.ump.ConsentDebugSettings;
15
- import com.google.android.ump.ConsentForm;
16
13
  import com.google.android.ump.ConsentInformation;
17
14
  import com.google.android.ump.ConsentRequestParameters;
18
- import com.google.android.ump.FormError;
19
15
  import com.google.android.ump.UserMessagingPlatform;
20
16
 
21
17
  public class AdConsentExecutor extends Executor {
@@ -71,6 +67,8 @@ public class AdConsentExecutor extends Executor {
71
67
  JSObject consentInfo = new JSObject();
72
68
  consentInfo.put("status", getConsentStatusString(consentInformation.getConsentStatus()));
73
69
  consentInfo.put("isConsentFormAvailable", consentInformation.isConsentFormAvailable());
70
+ consentInfo.put("canRequestAds", consentInformation.canRequestAds());
71
+ consentInfo.put("privacyOptionsRequirementStatus", consentInformation.getPrivacyOptionsRequirementStatus().name());
74
72
  call.resolve(consentInfo);
75
73
  },
76
74
  formError -> call.reject(formError.getMessage())
@@ -80,33 +78,53 @@ public class AdConsentExecutor extends Executor {
80
78
  }
81
79
  }
82
80
 
81
+ @PluginMethod
82
+ public void showPrivacyOptionsForm(final PluginCall call, BiConsumer<String, JSObject> notifyListenersFunction) {
83
+ try {
84
+ Activity activity = activitySupplier.get();
85
+ if (activity == null) {
86
+ call.reject("Trying to show the privacy options form but the Activity is null");
87
+ return;
88
+ }
89
+ ensureConsentInfo();
90
+ activity.runOnUiThread(() ->
91
+ UserMessagingPlatform.showPrivacyOptionsForm(activity, formError -> {
92
+ if (formError != null) {
93
+ call.reject("Error when show privacy form", formError.getMessage());
94
+ } else {
95
+ call.resolve();
96
+ }
97
+ })
98
+ );
99
+ } catch (Exception ex) {
100
+ call.reject(ex.getLocalizedMessage(), ex);
101
+ }
102
+ }
103
+
83
104
  @PluginMethod
84
105
  public void showConsentForm(final PluginCall call, BiConsumer<String, JSObject> notifyListenersFunction) {
85
106
  try {
86
- if (activitySupplier.get() == null) {
107
+ Activity activity = activitySupplier.get();
108
+ if (activity == null) {
87
109
  call.reject("Trying to show the consent form but the Activity is null");
88
110
  return;
89
111
  }
112
+
90
113
  ensureConsentInfo();
91
- activitySupplier
92
- .get()
93
- .runOnUiThread(() ->
94
- UserMessagingPlatform.loadConsentForm(
95
- contextSupplier.get(),
96
- consentForm ->
97
- consentForm.show(activitySupplier.get(), formError -> {
98
- if (formError != null) {
99
- call.reject("Error when show consent form", formError.getMessage());
100
- } else {
101
- JSObject consentFormInfo = new JSObject();
102
- consentFormInfo.put("status", getConsentStatusString(consentInformation.getConsentStatus()));
103
-
104
- call.resolve(consentFormInfo);
105
- }
106
- }),
107
- formError -> call.reject("Error when show consent form", formError.getMessage())
108
- )
109
- );
114
+ activity.runOnUiThread(() ->
115
+ UserMessagingPlatform.loadAndShowConsentFormIfRequired(activity, formError -> {
116
+ if (formError != null) {
117
+ call.reject("Error when show consent form", formError.getMessage());
118
+ return;
119
+ }
120
+
121
+ JSObject consentFormInfo = new JSObject();
122
+ consentFormInfo.put("status", getConsentStatusString(consentInformation.getConsentStatus()));
123
+ consentFormInfo.put("canRequestAds", consentInformation.canRequestAds());
124
+ consentFormInfo.put("privacyOptionsRequirementStatus", consentInformation.getPrivacyOptionsRequirementStatus().name());
125
+ call.resolve(consentFormInfo);
126
+ })
127
+ );
110
128
  } catch (Exception ex) {
111
129
  call.reject(ex.getLocalizedMessage(), ex);
112
130
  }
@@ -55,7 +55,7 @@ public class AdInterstitialExecutor extends Executor {
55
55
 
56
56
  public void showInterstitial(final PluginCall call, BiConsumer<String, JSObject> notifyListenersFunction) {
57
57
  if (interstitialAd == null) {
58
- String errorMessage = "No Interstitial can be show. It was not prepared or maybe it failed to be prepared.";
58
+ String errorMessage = "No Interstitial can be shown. It was not prepared or maybe it failed to be prepared.";
59
59
  call.reject(errorMessage);
60
60
  AdMobPluginError errorObject = new AdMobPluginError(-1, errorMessage);
61
61
  notifyListenersFunction.accept(InterstitialAdPluginPluginEvent.FailedToLoad, errorObject);
@@ -16,7 +16,9 @@ object InterstitialAdCallbackAndListeners {
16
16
  ): InterstitialAdLoadCallback {
17
17
  return object : InterstitialAdLoadCallback() {
18
18
  override fun onAdLoaded(ad: InterstitialAd) {
19
+ val immersiveMode = call.getBoolean("immersiveMode")
19
20
  ad.fullScreenContentCallback = FullscreenPluginCallback(InterstitialAdPluginPluginEvent, notifyListenersFunction)
21
+ ad.setImmersiveMode(immersiveMode ?: false)
20
22
 
21
23
  AdInterstitialExecutor.interstitialAd = ad
22
24
 
@@ -53,7 +53,7 @@ public class AdRewardExecutor extends Executor {
53
53
  @PluginMethod
54
54
  public void showRewardVideoAd(final PluginCall call, BiConsumer<String, JSObject> notifyListenersFunction) {
55
55
  if (mRewardedAd == null) {
56
- String errorMessage = "No Reward Video Ad can be show. It was not prepared or maybe it failed to be prepared.";
56
+ String errorMessage = "No Reward Video Ad can be shown. It was not prepared or maybe it failed to be prepared.";
57
57
  call.reject(errorMessage);
58
58
  AdMobPluginError errorObject = new AdMobPluginError(-1, errorMessage);
59
59
  notifyListenersFunction.accept(RewardAdPluginEvents.FailedToLoad, errorObject);
@@ -28,6 +28,9 @@ object RewardedAdCallbackAndListeners {
28
28
  fun getRewardedAdLoadCallback(call: PluginCall, notifyListenersFunction: BiConsumer<String, JSObject>, adOptions: AdOptions): RewardedAdLoadCallback {
29
29
  return object : RewardedAdLoadCallback() {
30
30
  override fun onAdLoaded(ad: RewardedAd) {
31
+ val immersiveMode = call.getBoolean("immersiveMode")
32
+ ad.setImmersiveMode(immersiveMode ?: false)
33
+
31
34
  AdRewardExecutor.mRewardedAd = ad
32
35
  AdRewardExecutor.mRewardedAd.fullScreenContentCallback = FullscreenPluginCallback(
33
36
  RewardAdPluginEvents, notifyListenersFunction)
@@ -57,7 +57,7 @@ public class AdRewardInterstitialExecutor extends Executor {
57
57
  @PluginMethod
58
58
  public void showRewardInterstitialAd(final PluginCall call, BiConsumer<String, JSObject> notifyListenersFunction) {
59
59
  if (mRewardedInterstitialAd == null) {
60
- String errorMessage = "No Reward Video Ad can be show. It was not prepared or maybe it failed to be prepared.";
60
+ String errorMessage = "No Reward Interstitial Video Ad can be shown. It was not prepared or maybe it failed to be prepared.";
61
61
  call.reject(errorMessage);
62
62
  AdMobPluginError errorObject = new AdMobPluginError(-1, errorMessage);
63
63
  notifyListenersFunction.accept(RewardInterstitialAdPluginEvents.FailedToLoad, errorObject);
package/dist/docs.json CHANGED
@@ -79,7 +79,7 @@
79
79
  "text": "5.2.0"
80
80
  }
81
81
  ],
82
- "docs": "request requestTrackingAuthorization (iOS >14).\nThis is deprecated method. We recommend UMP Consent.",
82
+ "docs": "request requestTrackingAuthorization (iOS >14).",
83
83
  "complexTypes": [],
84
84
  "slug": "requesttrackingauthorization"
85
85
  },
@@ -505,6 +505,25 @@
505
505
  ],
506
506
  "slug": "requestconsentinfo"
507
507
  },
508
+ {
509
+ "name": "showPrivacyOptionsForm",
510
+ "signature": "() => Promise<void>",
511
+ "parameters": [],
512
+ "returns": "Promise<void>",
513
+ "tags": [
514
+ {
515
+ "name": "group",
516
+ "text": "Consent"
517
+ },
518
+ {
519
+ "name": "since",
520
+ "text": "7.0.3"
521
+ }
522
+ ],
523
+ "docs": "Shows a google privacy options form (rendered from your GDPR message config).",
524
+ "complexTypes": [],
525
+ "slug": "showprivacyoptionsform"
526
+ },
508
527
  {
509
528
  "name": "showConsentForm",
510
529
  "signature": "() => Promise<AdmobConsentInfo>",
@@ -1385,7 +1404,7 @@
1385
1404
  "name": "since"
1386
1405
  }
1387
1406
  ],
1388
- "docs": "Margin Banner. Default is 0px;\r\nIf position is BOTTOM_CENTER, margin is be margin-bottom.\r\nIf position is TOP_CENTER, margin is be margin-top.",
1407
+ "docs": "Margin Banner. Default is 0px;\nIf position is BOTTOM_CENTER, margin is be margin-bottom.\nIf position is TOP_CENTER, margin is be margin-top.",
1389
1408
  "complexTypes": [],
1390
1409
  "type": "number | undefined"
1391
1410
  },
@@ -1409,7 +1428,27 @@
1409
1428
  "name": "since"
1410
1429
  }
1411
1430
  ],
1412
- "docs": "The default behavior of the Google Mobile Ads SDK is to serve personalized ads.\r\nSet this to true to request Non-Personalized Ads",
1431
+ "docs": "The default behavior of the Google Mobile Ads SDK is to serve personalized ads.\nSet this to true to request Non-Personalized Ads",
1432
+ "complexTypes": [],
1433
+ "type": "boolean | undefined"
1434
+ },
1435
+ {
1436
+ "name": "immersiveMode",
1437
+ "tags": [
1438
+ {
1439
+ "text": "https ://developers.google.com/admob/android/reference/com/google/android/gms/ads/interstitial/InterstitialAd#setImmersiveMode(boolean)",
1440
+ "name": "see"
1441
+ },
1442
+ {
1443
+ "text": "https ://developers.google.com/admob/android/reference/com/google/android/gms/ads/rewarded/RewardedAd#setImmersiveMode(boolean)",
1444
+ "name": "see"
1445
+ },
1446
+ {
1447
+ "text": "7.0.3",
1448
+ "name": "since"
1449
+ }
1450
+ ],
1451
+ "docs": "Sets a flag that controls if this interstitial or reward object will be displayed in immersive mode.\nCall this method before show.\nDuring show, if this flag is on and immersive mode is supported,\nSYSTEM_UI_FLAG_IMMERSIVE_STICKY &SYSTEM_UI_FLAG_HIDE_NAVIGATION will be turned on for interstitial or reward ad.",
1413
1452
  "complexTypes": [],
1414
1453
  "type": "boolean | undefined"
1415
1454
  }
@@ -1513,6 +1552,32 @@
1513
1552
  "docs": "If `true` a consent form is available and vice versa.",
1514
1553
  "complexTypes": [],
1515
1554
  "type": "boolean | undefined"
1555
+ },
1556
+ {
1557
+ "name": "canRequestAds",
1558
+ "tags": [
1559
+ {
1560
+ "text": "7.0.3",
1561
+ "name": "since"
1562
+ }
1563
+ ],
1564
+ "docs": "If `true` an ad can be shown.",
1565
+ "complexTypes": [],
1566
+ "type": "boolean"
1567
+ },
1568
+ {
1569
+ "name": "privacyOptionsRequirementStatus",
1570
+ "tags": [
1571
+ {
1572
+ "text": "7.0.3",
1573
+ "name": "since"
1574
+ }
1575
+ ],
1576
+ "docs": "Privacy options requirement status of the user.",
1577
+ "complexTypes": [
1578
+ "PrivacyOptionsRequirementStatus"
1579
+ ],
1580
+ "type": "PrivacyOptionsRequirementStatus"
1516
1581
  }
1517
1582
  ]
1518
1583
  },
@@ -1637,7 +1702,7 @@
1637
1702
  "name": "since"
1638
1703
  }
1639
1704
  ],
1640
- "docs": "Margin Banner. Default is 0px;\r\nIf position is BOTTOM_CENTER, margin is be margin-bottom.\r\nIf position is TOP_CENTER, margin is be margin-top.",
1705
+ "docs": "Margin Banner. Default is 0px;\nIf position is BOTTOM_CENTER, margin is be margin-bottom.\nIf position is TOP_CENTER, margin is be margin-top.",
1641
1706
  "complexTypes": [],
1642
1707
  "type": "number | undefined"
1643
1708
  },
@@ -1661,7 +1726,27 @@
1661
1726
  "name": "since"
1662
1727
  }
1663
1728
  ],
1664
- "docs": "The default behavior of the Google Mobile Ads SDK is to serve personalized ads.\r\nSet this to true to request Non-Personalized Ads",
1729
+ "docs": "The default behavior of the Google Mobile Ads SDK is to serve personalized ads.\nSet this to true to request Non-Personalized Ads",
1730
+ "complexTypes": [],
1731
+ "type": "boolean | undefined"
1732
+ },
1733
+ {
1734
+ "name": "immersiveMode",
1735
+ "tags": [
1736
+ {
1737
+ "text": "https ://developers.google.com/admob/android/reference/com/google/android/gms/ads/interstitial/InterstitialAd#setImmersiveMode(boolean)",
1738
+ "name": "see"
1739
+ },
1740
+ {
1741
+ "text": "https ://developers.google.com/admob/android/reference/com/google/android/gms/ads/rewarded/RewardedAd#setImmersiveMode(boolean)",
1742
+ "name": "see"
1743
+ },
1744
+ {
1745
+ "text": "7.0.3",
1746
+ "name": "since"
1747
+ }
1748
+ ],
1749
+ "docs": "Sets a flag that controls if this interstitial or reward object will be displayed in immersive mode.\nCall this method before show.\nDuring show, if this flag is on and immersive mode is supported,\nSYSTEM_UI_FLAG_IMMERSIVE_STICKY &SYSTEM_UI_FLAG_HIDE_NAVIGATION will be turned on for interstitial or reward ad.",
1665
1750
  "complexTypes": [],
1666
1751
  "type": "boolean | undefined"
1667
1752
  }
@@ -1735,7 +1820,7 @@
1735
1820
  "name": "since"
1736
1821
  }
1737
1822
  ],
1738
- "docs": "Margin Banner. Default is 0px;\r\nIf position is BOTTOM_CENTER, margin is be margin-bottom.\r\nIf position is TOP_CENTER, margin is be margin-top.",
1823
+ "docs": "Margin Banner. Default is 0px;\nIf position is BOTTOM_CENTER, margin is be margin-bottom.\nIf position is TOP_CENTER, margin is be margin-top.",
1739
1824
  "complexTypes": [],
1740
1825
  "type": "number | undefined"
1741
1826
  },
@@ -1759,7 +1844,27 @@
1759
1844
  "name": "since"
1760
1845
  }
1761
1846
  ],
1762
- "docs": "The default behavior of the Google Mobile Ads SDK is to serve personalized ads.\r\nSet this to true to request Non-Personalized Ads",
1847
+ "docs": "The default behavior of the Google Mobile Ads SDK is to serve personalized ads.\nSet this to true to request Non-Personalized Ads",
1848
+ "complexTypes": [],
1849
+ "type": "boolean | undefined"
1850
+ },
1851
+ {
1852
+ "name": "immersiveMode",
1853
+ "tags": [
1854
+ {
1855
+ "text": "https ://developers.google.com/admob/android/reference/com/google/android/gms/ads/interstitial/InterstitialAd#setImmersiveMode(boolean)",
1856
+ "name": "see"
1857
+ },
1858
+ {
1859
+ "text": "https ://developers.google.com/admob/android/reference/com/google/android/gms/ads/rewarded/RewardedAd#setImmersiveMode(boolean)",
1860
+ "name": "see"
1861
+ },
1862
+ {
1863
+ "text": "7.0.3",
1864
+ "name": "since"
1865
+ }
1866
+ ],
1867
+ "docs": "Sets a flag that controls if this interstitial or reward object will be displayed in immersive mode.\nCall this method before show.\nDuring show, if this flag is on and immersive mode is supported,\nSYSTEM_UI_FLAG_IMMERSIVE_STICKY &SYSTEM_UI_FLAG_HIDE_NAVIGATION will be turned on for interstitial or reward ad.",
1763
1868
  "complexTypes": [],
1764
1869
  "type": "boolean | undefined"
1765
1870
  }
@@ -1857,7 +1962,7 @@
1857
1962
  "name": "since"
1858
1963
  }
1859
1964
  ],
1860
- "docs": "Margin Banner. Default is 0px;\r\nIf position is BOTTOM_CENTER, margin is be margin-bottom.\r\nIf position is TOP_CENTER, margin is be margin-top.",
1965
+ "docs": "Margin Banner. Default is 0px;\nIf position is BOTTOM_CENTER, margin is be margin-bottom.\nIf position is TOP_CENTER, margin is be margin-top.",
1861
1966
  "complexTypes": [],
1862
1967
  "type": "number | undefined"
1863
1968
  },
@@ -1881,7 +1986,27 @@
1881
1986
  "name": "since"
1882
1987
  }
1883
1988
  ],
1884
- "docs": "The default behavior of the Google Mobile Ads SDK is to serve personalized ads.\r\nSet this to true to request Non-Personalized Ads",
1989
+ "docs": "The default behavior of the Google Mobile Ads SDK is to serve personalized ads.\nSet this to true to request Non-Personalized Ads",
1990
+ "complexTypes": [],
1991
+ "type": "boolean | undefined"
1992
+ },
1993
+ {
1994
+ "name": "immersiveMode",
1995
+ "tags": [
1996
+ {
1997
+ "text": "https ://developers.google.com/admob/android/reference/com/google/android/gms/ads/interstitial/InterstitialAd#setImmersiveMode(boolean)",
1998
+ "name": "see"
1999
+ },
2000
+ {
2001
+ "text": "https ://developers.google.com/admob/android/reference/com/google/android/gms/ads/rewarded/RewardedAd#setImmersiveMode(boolean)",
2002
+ "name": "see"
2003
+ },
2004
+ {
2005
+ "text": "7.0.3",
2006
+ "name": "since"
2007
+ }
2008
+ ],
2009
+ "docs": "Sets a flag that controls if this interstitial or reward object will be displayed in immersive mode.\nCall this method before show.\nDuring show, if this flag is on and immersive mode is supported,\nSYSTEM_UI_FLAG_IMMERSIVE_STICKY &SYSTEM_UI_FLAG_HIDE_NAVIGATION will be turned on for interstitial or reward ad.",
1885
2010
  "complexTypes": [],
1886
2011
  "type": "boolean | undefined"
1887
2012
  }
@@ -2092,6 +2217,30 @@
2092
2217
  }
2093
2218
  ]
2094
2219
  },
2220
+ {
2221
+ "name": "PrivacyOptionsRequirementStatus",
2222
+ "slug": "privacyoptionsrequirementstatus",
2223
+ "members": [
2224
+ {
2225
+ "name": "NOT_REQUIRED",
2226
+ "value": "'NOT_REQUIRED'",
2227
+ "tags": [],
2228
+ "docs": "Privacy options entry point is not required."
2229
+ },
2230
+ {
2231
+ "name": "REQUIRED",
2232
+ "value": "'REQUIRED'",
2233
+ "tags": [],
2234
+ "docs": "Privacy options entry point is required."
2235
+ },
2236
+ {
2237
+ "name": "UNKNOWN",
2238
+ "value": "'UNKNOWN'",
2239
+ "tags": [],
2240
+ "docs": "Privacy options requirement status is unknown."
2241
+ }
2242
+ ]
2243
+ },
2095
2244
  {
2096
2245
  "name": "AdmobConsentDebugGeography",
2097
2246
  "slug": "admobconsentdebuggeography",
@@ -2111,8 +2260,24 @@
2111
2260
  {
2112
2261
  "name": "NOT_EEA",
2113
2262
  "value": "2",
2114
- "tags": [],
2263
+ "tags": [
2264
+ {
2265
+ "name": "deprecated"
2266
+ }
2267
+ ],
2115
2268
  "docs": "Geography appears as not in EEA for debug devices."
2269
+ },
2270
+ {
2271
+ "name": "US",
2272
+ "value": "3",
2273
+ "tags": [],
2274
+ "docs": "Geography appears as in regulated US state for debug devices."
2275
+ },
2276
+ {
2277
+ "name": "OTHER",
2278
+ "value": "4",
2279
+ "tags": [],
2280
+ "docs": "Geography appears as OTHER state for debug devices."
2116
2281
  }
2117
2282
  ]
2118
2283
  },
@@ -14,6 +14,15 @@ export declare enum AdmobConsentDebugGeography {
14
14
  EEA = 1,
15
15
  /**
16
16
  * Geography appears as not in EEA for debug devices.
17
+ * @deprecated
17
18
  */
18
- NOT_EEA = 2
19
+ NOT_EEA = 2,
20
+ /**
21
+ * Geography appears as in regulated US state for debug devices.
22
+ */
23
+ US = 3,
24
+ /**
25
+ * Geography appears as OTHER state for debug devices.
26
+ */
27
+ OTHER = 4
19
28
  }
@@ -15,7 +15,16 @@ export var AdmobConsentDebugGeography;
15
15
  AdmobConsentDebugGeography[AdmobConsentDebugGeography["EEA"] = 1] = "EEA";
16
16
  /**
17
17
  * Geography appears as not in EEA for debug devices.
18
+ * @deprecated
18
19
  */
19
20
  AdmobConsentDebugGeography[AdmobConsentDebugGeography["NOT_EEA"] = 2] = "NOT_EEA";
21
+ /**
22
+ * Geography appears as in regulated US state for debug devices.
23
+ */
24
+ AdmobConsentDebugGeography[AdmobConsentDebugGeography["US"] = 3] = "US";
25
+ /**
26
+ * Geography appears as OTHER state for debug devices.
27
+ */
28
+ AdmobConsentDebugGeography[AdmobConsentDebugGeography["OTHER"] = 4] = "OTHER";
20
29
  })(AdmobConsentDebugGeography || (AdmobConsentDebugGeography = {}));
21
30
  //# sourceMappingURL=consent-debug-geography.enum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"consent-debug-geography.enum.js","sourceRoot":"","sources":["../../../src/consent/consent-debug-geography.enum.ts"],"names":[],"mappings":"AAAA;;;;KAIK;AAEL,MAAM,CAAN,IAAY,0BAeX;AAfD,WAAY,0BAA0B;IACpC;;OAEG;IACH,mFAAY,CAAA;IAEZ;;OAEG;IACH,yEAAO,CAAA;IAEP;;OAEG;IACH,iFAAW,CAAA;AACb,CAAC,EAfW,0BAA0B,KAA1B,0BAA0B,QAerC"}
1
+ {"version":3,"file":"consent-debug-geography.enum.js","sourceRoot":"","sources":["../../../src/consent/consent-debug-geography.enum.ts"],"names":[],"mappings":"AAAA;;;;KAIK;AAEL,MAAM,CAAN,IAAY,0BA0BX;AA1BD,WAAY,0BAA0B;IACpC;;OAEG;IACH,mFAAY,CAAA;IAEZ;;OAEG;IACH,yEAAO,CAAA;IAEP;;;OAGG;IACH,iFAAW,CAAA;IAEX;;OAEG;IACH,uEAAM,CAAA;IAEN;;OAEG;IACH,6EAAS,CAAA;AACX,CAAC,EA1BW,0BAA0B,KAA1B,0BAA0B,QA0BrC"}
@@ -9,6 +9,13 @@ export interface AdmobConsentDefinitions {
9
9
  * @since 5.0.0
10
10
  */
11
11
  requestConsentInfo(options?: AdmobConsentRequestOptions): Promise<AdmobConsentInfo>;
12
+ /**
13
+ * Shows a google privacy options form (rendered from your GDPR message config).
14
+ *
15
+ * @group Consent
16
+ * @since 7.0.3
17
+ */
18
+ showPrivacyOptionsForm(): Promise<void>;
12
19
  /**
13
20
  * Shows a google user consent form (rendered from your GDPR message config).
14
21
  *
@@ -1,4 +1,5 @@
1
1
  import type { AdmobConsentStatus } from './consent-status.enum';
2
+ import type { PrivacyOptionsRequirementStatus } from './privacy-options-requirement-status.enum';
2
3
  export interface AdmobConsentInfo {
3
4
  /**
4
5
  * The consent status of the user.
@@ -10,4 +11,14 @@ export interface AdmobConsentInfo {
10
11
  * @since 5.0.0
11
12
  */
12
13
  isConsentFormAvailable?: boolean;
14
+ /**
15
+ * If `true` an ad can be shown.
16
+ * @since 7.0.3
17
+ */
18
+ canRequestAds: boolean;
19
+ /**
20
+ * Privacy options requirement status of the user.
21
+ * @since 7.0.3
22
+ */
23
+ privacyOptionsRequirementStatus: PrivacyOptionsRequirementStatus;
13
24
  }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * For more information:
3
+ * https://developers.google.com/admob/unity/reference/namespace/google-mobile-ads/ump/api#privacyoptionsrequirementstatus
4
+ *
5
+ * */
6
+ export declare enum PrivacyOptionsRequirementStatus {
7
+ /**
8
+ * Privacy options entry point is not required.
9
+ */
10
+ NOT_REQUIRED = "NOT_REQUIRED",
11
+ /**
12
+ * Privacy options entry point is required.
13
+ */
14
+ REQUIRED = "REQUIRED",
15
+ /**
16
+ * Privacy options requirement status is unknown.
17
+ */
18
+ UNKNOWN = "UNKNOWN"
19
+ }