@ququplay/admob 7.0.3 → 8.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.
Files changed (49) hide show
  1. package/Package.swift +6 -4
  2. package/QuquplayAdmob.podspec +3 -2
  3. package/README.md +90 -39
  4. package/android/build.gradle +23 -22
  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 +19 -0
  7. package/android/src/main/java/com/getcapacitor/community/admob/consent/AdConsentExecutor.java +47 -25
  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 +422 -101
  14. package/dist/esm/banner/banner-definitions.interface.d.ts +1 -1
  15. package/dist/esm/consent/consent-debug-geography.enum.d.ts +10 -1
  16. package/dist/esm/consent/consent-debug-geography.enum.js +9 -0
  17. package/dist/esm/consent/consent-debug-geography.enum.js.map +1 -1
  18. package/dist/esm/consent/consent-definition.interface.d.ts +7 -0
  19. package/dist/esm/consent/consent-info.interface.d.ts +11 -0
  20. package/dist/esm/consent/privacy-options-requirement-status.enum.d.ts +19 -0
  21. package/dist/esm/consent/privacy-options-requirement-status.enum.js +21 -0
  22. package/dist/esm/consent/privacy-options-requirement-status.enum.js.map +1 -0
  23. package/dist/esm/definitions.d.ts +1 -2
  24. package/dist/esm/definitions.js.map +1 -1
  25. package/dist/esm/interstitial/interstitial-definitions.interface.d.ts +1 -1
  26. package/dist/esm/private/validate-all-events-implemented.type.d.ts +8 -8
  27. package/dist/esm/reward/reward-ad-options.interface.d.ts +1 -1
  28. package/dist/esm/reward/reward-definitions.interface.d.ts +1 -1
  29. package/dist/esm/reward-interstitial/reward-interstitial-ad-options.interface.d.ts +1 -1
  30. package/dist/esm/reward-interstitial/reward-interstitial-definitions.interface.d.ts +1 -1
  31. package/dist/esm/shared/ad-options.interface.d.ts +11 -0
  32. package/dist/esm/web.d.ts +1 -0
  33. package/dist/esm/web.js +8 -0
  34. package/dist/esm/web.js.map +1 -1
  35. package/dist/plugin.cjs.js +37 -0
  36. package/dist/plugin.cjs.js.map +1 -1
  37. package/dist/plugin.js +37 -0
  38. package/dist/plugin.js.map +1 -1
  39. package/ios/Sources/AdMobPlugin/AdMobPlugin.swift +26 -21
  40. package/ios/Sources/AdMobPlugin/Banner/BannerExecutor.swift +51 -59
  41. package/ios/Sources/AdMobPlugin/Consent/ConsentExecutor.swift +65 -45
  42. package/ios/Sources/AdMobPlugin/Interstitial/AdInterstitialExecutor.swift +9 -9
  43. package/ios/Sources/AdMobPlugin/Rewarded/AdRewardExecutor.swift +11 -11
  44. package/ios/Sources/AdMobPlugin/RewardedInterstitial/AdRewardInterstitialExecutor.swift +11 -11
  45. package/package.json +15 -15
  46. package/android/src/main/res/layout/bridge_layout_main.xml +0 -15
  47. package/android/src/main/res/values/colors.xml +0 -3
  48. package/android/src/main/res/values/strings.xml +0 -2
  49. package/android/src/main/res/values/styles.xml +0 -3
@@ -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-interstitial/reward-interstitial-ad-plugin-events.enum.js","esm/reward/reward-ad-plugin-events.enum.js","esm/consent/consent-status.enum.js","esm/consent/consent-debug-geography.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 RewardInterstitialAdPluginEvents;\n(function (RewardInterstitialAdPluginEvents) {\n /**\n * Emits after trying to prepare a RewardAd and the Video is loaded and ready to be show\n */\n RewardInterstitialAdPluginEvents[\"Loaded\"] = \"onRewardedInterstitialAdLoaded\";\n /**\n * Emits after trying to prepare a RewardAd when it could not be loaded\n */\n RewardInterstitialAdPluginEvents[\"FailedToLoad\"] = \"onRewardedInterstitialAdFailedToLoad\";\n /**\n * Emits when the AdReward video is visible to the user\n */\n RewardInterstitialAdPluginEvents[\"Showed\"] = \"onRewardedInterstitialAdShowed\";\n /**\n * Emits when the AdReward video is failed to show\n */\n RewardInterstitialAdPluginEvents[\"FailedToShow\"] = \"onRewardedInterstitialAdFailedToShow\";\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 RewardInterstitialAdPluginEvents[\"Dismissed\"] = \"onRewardedInterstitialAdDismissed\";\n /**\n * Emits when user get rewarded from AdReward\n */\n RewardInterstitialAdPluginEvents[\"Rewarded\"] = \"onRewardedInterstitialAdReward\";\n})(RewardInterstitialAdPluginEvents || (RewardInterstitialAdPluginEvents = {}));\n//# sourceMappingURL=reward-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","/**\n * For more information:\n * https://developers.google.com/admob/unity/reference/namespace/google-mobile-ads/ump/api#consentstatus\n *\n * */\nexport var AdmobConsentStatus;\n(function (AdmobConsentStatus) {\n /**\n * User consent not required.\n */\n AdmobConsentStatus[\"NOT_REQUIRED\"] = \"NOT_REQUIRED\";\n /**\n * User consent already obtained.\n */\n AdmobConsentStatus[\"OBTAINED\"] = \"OBTAINED\";\n /**\n * User consent required but not yet obtained.\n */\n AdmobConsentStatus[\"REQUIRED\"] = \"REQUIRED\";\n /**\n * Unknown consent status, AdsConsent.requestInfoUpdate needs to be called to update it.\n */\n AdmobConsentStatus[\"UNKNOWN\"] = \"UNKNOWN\";\n})(AdmobConsentStatus || (AdmobConsentStatus = {}));\n//# sourceMappingURL=consent-status.enum.js.map","/**\n * For more information:\n * https://developers.google.com/admob/unity/reference/namespace/google-mobile-ads/ump/api#debuggeography\n *\n * */\nexport var AdmobConsentDebugGeography;\n(function (AdmobConsentDebugGeography) {\n /**\n * Debug geography disabled.\n */\n AdmobConsentDebugGeography[AdmobConsentDebugGeography[\"DISABLED\"] = 0] = \"DISABLED\";\n /**\n * Geography appears as in EEA for debug devices.\n */\n AdmobConsentDebugGeography[AdmobConsentDebugGeography[\"EEA\"] = 1] = \"EEA\";\n /**\n * Geography appears as not in EEA for debug devices.\n */\n AdmobConsentDebugGeography[AdmobConsentDebugGeography[\"NOT_EEA\"] = 2] = \"NOT_EEA\";\n})(AdmobConsentDebugGeography || (AdmobConsentDebugGeography = {}));\n//# sourceMappingURL=consent-debug-geography.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-interstitial/index';\nexport * from './reward/index';\nexport * from './consent/index';\nexport * from './shared/index';\nexport { AdMob };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { AdmobConsentStatus } from './consent/consent-status.enum';\nexport class AdMobWeb extends WebPlugin {\n async initialize() {\n console.log('initialize');\n }\n async requestTrackingAuthorization() {\n console.log('requestTrackingAuthorization');\n }\n async trackingAuthorizationStatus() {\n return {\n status: 'authorized',\n };\n }\n async requestConsentInfo(options) {\n console.log('requestConsentInfo', options);\n return {\n status: AdmobConsentStatus.REQUIRED,\n isConsentFormAvailable: true,\n };\n }\n async showConsentForm() {\n console.log('showConsentForm');\n return {\n status: AdmobConsentStatus.REQUIRED,\n };\n }\n async resetConsentInfo() {\n console.log('resetConsentInfo');\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 async prepareRewardInterstitialAd(options) {\n console.log(options);\n return {\n adUnitId: options.adId,\n };\n }\n async showRewardInterstitialAd() {\n return {\n type: '',\n amount: 0,\n };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["MaxAdContentRating","BannerAdPluginEvents","BannerAdPosition","BannerAdSize","InterstitialAdPluginEvents","RewardInterstitialAdPluginEvents","RewardAdPluginEvents","AdmobConsentStatus","AdmobConsentDebugGeography","registerPlugin","WebPlugin"],"mappings":";;;AAAWA;IACX,CAAC,UAAU,kBAAkB,EAAE;IAC/B;IACA;IACA;IACA,IAAI,kBAAkB,CAAC,SAAS,CAAC,GAAG,SAAS;IAC7C;IACA;IACA;IACA,IAAI,kBAAkB,CAAC,kBAAkB,CAAC,GAAG,kBAAkB;IAC/D;IACA;IACA;IACA,IAAI,kBAAkB,CAAC,MAAM,CAAC,GAAG,MAAM;IACvC;IACA;IACA;IACA,IAAI,kBAAkB,CAAC,gBAAgB,CAAC,GAAG,gBAAgB;IAC3D,CAAC,EAAEA,0BAAkB,KAAKA,0BAAkB,GAAG,EAAE,CAAC,CAAC;;IClBnD;AACWC;IACX,CAAC,UAAU,oBAAoB,EAAE;IACjC,IAAI,oBAAoB,CAAC,aAAa,CAAC,GAAG,qBAAqB;IAC/D,IAAI,oBAAoB,CAAC,QAAQ,CAAC,GAAG,gBAAgB;IACrD,IAAI,oBAAoB,CAAC,cAAc,CAAC,GAAG,sBAAsB;IACjE;IACA;IACA;IACA,IAAI,oBAAoB,CAAC,QAAQ,CAAC,GAAG,gBAAgB;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,IAAI,MAAM,YAAY,GAAG;IACzB,QAAQ,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;IACnC;IACA;IACA,IAAI,MAAM,YAAY,GAAG;IACzB,QAAQ,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;IACnC;IACA,IAAI,MAAM,mBAAmB,CAAC,OAAO,EAAE;IACvC,QAAQ,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,OAAO,CAAC;IACnD,QAAQ,OAAO;IACf,YAAY,QAAQ,EAAE,OAAO,CAAC,IAAI;IAClC,SAAS;IACT;IACA,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;IACvC;IACA,IAAI,MAAM,oBAAoB,CAAC,OAAO,EAAE;IACxC,QAAQ,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;IAC5B,QAAQ,OAAO;IACf,YAAY,QAAQ,EAAE,OAAO,CAAC,IAAI;IAClC,SAAS;IACT;IACA,IAAI,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,OAAO;IACf,YAAY,IAAI,EAAE,EAAE;IACpB,YAAY,MAAM,EAAE,CAAC;IACrB,SAAS;IACT;IACA,IAAI,MAAM,2BAA2B,CAAC,OAAO,EAAE;IAC/C,QAAQ,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;IAC5B,QAAQ,OAAO;IACf,YAAY,QAAQ,EAAE,OAAO,CAAC,IAAI;IAClC,SAAS;IACT;IACA,IAAI,MAAM,wBAAwB,GAAG;IACrC,QAAQ,OAAO;IACf,YAAY,IAAI,EAAE,EAAE;IACpB,YAAY,MAAM,EAAE,CAAC;IACrB,SAAS;IACT;IACA;;;;;;;;;;;;;;;"}
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-interstitial/reward-interstitial-ad-plugin-events.enum.js","esm/reward/reward-ad-plugin-events.enum.js","esm/consent/consent-status.enum.js","esm/consent/consent-debug-geography.enum.js","esm/index.js","esm/consent/privacy-options-requirement-status.enum.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 RewardInterstitialAdPluginEvents;\n(function (RewardInterstitialAdPluginEvents) {\n /**\n * Emits after trying to prepare a RewardAd and the Video is loaded and ready to be show\n */\n RewardInterstitialAdPluginEvents[\"Loaded\"] = \"onRewardedInterstitialAdLoaded\";\n /**\n * Emits after trying to prepare a RewardAd when it could not be loaded\n */\n RewardInterstitialAdPluginEvents[\"FailedToLoad\"] = \"onRewardedInterstitialAdFailedToLoad\";\n /**\n * Emits when the AdReward video is visible to the user\n */\n RewardInterstitialAdPluginEvents[\"Showed\"] = \"onRewardedInterstitialAdShowed\";\n /**\n * Emits when the AdReward video is failed to show\n */\n RewardInterstitialAdPluginEvents[\"FailedToShow\"] = \"onRewardedInterstitialAdFailedToShow\";\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 RewardInterstitialAdPluginEvents[\"Dismissed\"] = \"onRewardedInterstitialAdDismissed\";\n /**\n * Emits when user get rewarded from AdReward\n */\n RewardInterstitialAdPluginEvents[\"Rewarded\"] = \"onRewardedInterstitialAdReward\";\n})(RewardInterstitialAdPluginEvents || (RewardInterstitialAdPluginEvents = {}));\n//# sourceMappingURL=reward-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","/**\n * For more information:\n * https://developers.google.com/admob/unity/reference/namespace/google-mobile-ads/ump/api#consentstatus\n *\n * */\nexport var AdmobConsentStatus;\n(function (AdmobConsentStatus) {\n /**\n * User consent not required.\n */\n AdmobConsentStatus[\"NOT_REQUIRED\"] = \"NOT_REQUIRED\";\n /**\n * User consent already obtained.\n */\n AdmobConsentStatus[\"OBTAINED\"] = \"OBTAINED\";\n /**\n * User consent required but not yet obtained.\n */\n AdmobConsentStatus[\"REQUIRED\"] = \"REQUIRED\";\n /**\n * Unknown consent status, AdsConsent.requestInfoUpdate needs to be called to update it.\n */\n AdmobConsentStatus[\"UNKNOWN\"] = \"UNKNOWN\";\n})(AdmobConsentStatus || (AdmobConsentStatus = {}));\n//# sourceMappingURL=consent-status.enum.js.map","/**\n * For more information:\n * https://developers.google.com/admob/unity/reference/namespace/google-mobile-ads/ump/api#debuggeography\n *\n * */\nexport var AdmobConsentDebugGeography;\n(function (AdmobConsentDebugGeography) {\n /**\n * Debug geography disabled.\n */\n AdmobConsentDebugGeography[AdmobConsentDebugGeography[\"DISABLED\"] = 0] = \"DISABLED\";\n /**\n * Geography appears as in EEA for debug devices.\n */\n AdmobConsentDebugGeography[AdmobConsentDebugGeography[\"EEA\"] = 1] = \"EEA\";\n /**\n * Geography appears as not in EEA for debug devices.\n * @deprecated\n */\n AdmobConsentDebugGeography[AdmobConsentDebugGeography[\"NOT_EEA\"] = 2] = \"NOT_EEA\";\n /**\n * Geography appears as in regulated US state for debug devices.\n */\n AdmobConsentDebugGeography[AdmobConsentDebugGeography[\"US\"] = 3] = \"US\";\n /**\n * Geography appears as OTHER state for debug devices.\n */\n AdmobConsentDebugGeography[AdmobConsentDebugGeography[\"OTHER\"] = 4] = \"OTHER\";\n})(AdmobConsentDebugGeography || (AdmobConsentDebugGeography = {}));\n//# sourceMappingURL=consent-debug-geography.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-interstitial/index';\nexport * from './reward/index';\nexport * from './consent/index';\nexport * from './shared/index';\nexport { AdMob };\n//# sourceMappingURL=index.js.map","/**\n * For more information:\n * https://developers.google.com/admob/unity/reference/namespace/google-mobile-ads/ump/api#privacyoptionsrequirementstatus\n *\n * */\nexport var PrivacyOptionsRequirementStatus;\n(function (PrivacyOptionsRequirementStatus) {\n /**\n * Privacy options entry point is not required.\n */\n PrivacyOptionsRequirementStatus[\"NOT_REQUIRED\"] = \"NOT_REQUIRED\";\n /**\n * Privacy options entry point is required.\n */\n PrivacyOptionsRequirementStatus[\"REQUIRED\"] = \"REQUIRED\";\n /**\n * Privacy options requirement status is unknown.\n */\n PrivacyOptionsRequirementStatus[\"UNKNOWN\"] = \"UNKNOWN\";\n})(PrivacyOptionsRequirementStatus || (PrivacyOptionsRequirementStatus = {}));\n//# sourceMappingURL=privacy-options-requirement-status.enum.js.map","import { WebPlugin } from '@capacitor/core';\nimport { AdmobConsentStatus } from './consent/consent-status.enum';\nimport { PrivacyOptionsRequirementStatus } from './consent/privacy-options-requirement-status.enum';\nexport class AdMobWeb extends WebPlugin {\n async initialize() {\n console.log('initialize');\n }\n async requestTrackingAuthorization() {\n console.log('requestTrackingAuthorization');\n }\n async trackingAuthorizationStatus() {\n return {\n status: 'authorized',\n };\n }\n async requestConsentInfo(options) {\n console.log('requestConsentInfo', options);\n return {\n status: AdmobConsentStatus.REQUIRED,\n isConsentFormAvailable: true,\n canRequestAds: true,\n privacyOptionsRequirementStatus: PrivacyOptionsRequirementStatus.REQUIRED,\n };\n }\n async showPrivacyOptionsForm() {\n console.log('showPrivacyOptionsForm');\n }\n async showConsentForm() {\n console.log('showConsentForm');\n return {\n status: AdmobConsentStatus.REQUIRED,\n canRequestAds: true,\n privacyOptionsRequirementStatus: PrivacyOptionsRequirementStatus.REQUIRED,\n };\n }\n async resetConsentInfo() {\n console.log('resetConsentInfo');\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 async prepareRewardInterstitialAd(options) {\n console.log(options);\n return {\n adUnitId: options.adId,\n };\n }\n async showRewardInterstitialAd() {\n return {\n type: '',\n amount: 0,\n };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["MaxAdContentRating","BannerAdPluginEvents","BannerAdPosition","BannerAdSize","InterstitialAdPluginEvents","RewardInterstitialAdPluginEvents","RewardAdPluginEvents","AdmobConsentStatus","AdmobConsentDebugGeography","registerPlugin","WebPlugin"],"mappings":";;;AAAWA;IACX,CAAC,UAAU,kBAAkB,EAAE;IAC/B;IACA;IACA;IACA,IAAI,kBAAkB,CAAC,SAAS,CAAC,GAAG,SAAS;IAC7C;IACA;IACA;IACA,IAAI,kBAAkB,CAAC,kBAAkB,CAAC,GAAG,kBAAkB;IAC/D;IACA;IACA;IACA,IAAI,kBAAkB,CAAC,MAAM,CAAC,GAAG,MAAM;IACvC;IACA;IACA;IACA,IAAI,kBAAkB,CAAC,gBAAgB,CAAC,GAAG,gBAAgB;IAC3D,CAAC,EAAEA,0BAAkB,KAAKA,0BAAkB,GAAG,EAAE,CAAC,CAAC;;IClBnD;AACWC;IACX,CAAC,UAAU,oBAAoB,EAAE;IACjC,IAAI,oBAAoB,CAAC,aAAa,CAAC,GAAG,qBAAqB;IAC/D,IAAI,oBAAoB,CAAC,QAAQ,CAAC,GAAG,gBAAgB;IACrD,IAAI,oBAAoB,CAAC,cAAc,CAAC,GAAG,sBAAsB;IACjE;IACA;IACA;IACA,IAAI,oBAAoB,CAAC,QAAQ,CAAC,GAAG,gBAAgB;IACrD;IACA;IACA;IACA,IAAI,oBAAoB,CAAC,QAAQ,CAAC,GAAG,gBAAgB;IACrD;IACA;IACA;IACA,IAAI,oBAAoB,CAAC,cAAc,CAAC,GAAG,oBAAoB;IAC/D,CAAC,EAAEA,4BAAo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xC,QAAQ,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;IAC5B,QAAQ,OAAO;IACf,YAAY,QAAQ,EAAE,OAAO,CAAC,IAAI;IAClC,SAAS;IACT,IAAI;IACJ,IAAI,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,OAAO;IACf,YAAY,IAAI,EAAE,EAAE;IACpB,YAAY,MAAM,EAAE,CAAC;IACrB,SAAS;IACT,IAAI;IACJ,IAAI,MAAM,2BAA2B,CAAC,OAAO,EAAE;IAC/C,QAAQ,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;IAC5B,QAAQ,OAAO;IACf,YAAY,QAAQ,EAAE,OAAO,CAAC,IAAI;IAClC,SAAS;IACT,IAAI;IACJ,IAAI,MAAM,wBAAwB,GAAG;IACrC,QAAQ,OAAO;IACf,YAAY,IAAI,EAAE,EAAE;IACpB,YAAY,MAAM,EAAE,CAAC;IACrB,SAAS;IACT,IAAI;IACJ;;;;;;;;;;;;;;;"}
@@ -13,6 +13,7 @@ public class AdMobPlugin: CAPPlugin, CAPBridgedPlugin {
13
13
  CAPPluginMethod(name: "initialize", returnType: CAPPluginReturnPromise),
14
14
  CAPPluginMethod(name: "trackingAuthorizationStatus", returnType: CAPPluginReturnPromise),
15
15
  CAPPluginMethod(name: "requestConsentInfo", returnType: CAPPluginReturnPromise),
16
+ CAPPluginMethod(name: "showPrivacyOptionsForm", returnType: CAPPluginReturnPromise),
16
17
  CAPPluginMethod(name: "requestTrackingAuthorization", returnType: CAPPluginReturnPromise),
17
18
  CAPPluginMethod(name: "showConsentForm", returnType: CAPPluginReturnPromise),
18
19
  CAPPluginMethod(name: "resetConsentInfo", returnType: CAPPluginReturnPromise),
@@ -25,7 +26,9 @@ public class AdMobPlugin: CAPPlugin, CAPBridgedPlugin {
25
26
  CAPPluginMethod(name: "prepareInterstitial", returnType: CAPPluginReturnPromise),
26
27
  CAPPluginMethod(name: "showInterstitial", returnType: CAPPluginReturnPromise),
27
28
  CAPPluginMethod(name: "prepareRewardVideoAd", returnType: CAPPluginReturnPromise),
28
- CAPPluginMethod(name: "showRewardVideoAd", returnType: CAPPluginReturnPromise)
29
+ CAPPluginMethod(name: "showRewardVideoAd", returnType: CAPPluginReturnPromise),
30
+ CAPPluginMethod(name: "prepareRewardInterstitialAd", returnType: CAPPluginReturnPromise),
31
+ CAPPluginMethod(name: "showRewardInterstitialAd", returnType: CAPPluginReturnPromise)
29
32
  ]
30
33
 
31
34
  var testingDevices: [String] = []
@@ -49,7 +52,7 @@ public class AdMobPlugin: CAPPlugin, CAPBridgedPlugin {
49
52
  self.consentExecutor.plugin = self
50
53
  self.setRequestConfiguration(call)
51
54
 
52
- GADMobileAds.sharedInstance().start(completionHandler: nil)
55
+ MobileAds.shared.start(completionHandler: nil)
53
56
  call.resolve([:])
54
57
  }
55
58
 
@@ -72,7 +75,7 @@ public class AdMobPlugin: CAPPlugin, CAPBridgedPlugin {
72
75
 
73
76
  @objc func setApplicationMuted(_ call: CAPPluginCall) {
74
77
  if let shouldMute = call.getBool("muted") {
75
- GADMobileAds.sharedInstance().applicationMuted = shouldMute
78
+ MobileAds.shared.isApplicationMuted = shouldMute
76
79
  call.resolve([:])
77
80
  } else {
78
81
  call.reject("muted property cannot be null")
@@ -85,7 +88,7 @@ public class AdMobPlugin: CAPPlugin, CAPBridgedPlugin {
85
88
  // Clamp volumes.
86
89
  if volume < 0.0 {volume = 0.0} else if volume > 1.0 {volume = 1.0}
87
90
 
88
- GADMobileAds.sharedInstance().applicationVolume = volume
91
+ MobileAds.shared.applicationVolume = volume
89
92
 
90
93
  call.resolve([:])
91
94
  } else {
@@ -188,16 +191,12 @@ public class AdMobPlugin: CAPPlugin, CAPBridgedPlugin {
188
191
  switch ATTrackingManager.trackingAuthorizationStatus {
189
192
  case .authorized:
190
193
  call.resolve(["status": AuthorizationStatusEnum.Authorized.rawValue])
191
- break
192
- case .denied:
194
+ case .denied:
193
195
  call.resolve(["status": AuthorizationStatusEnum.Denied.rawValue])
194
- break
195
- case .restricted:
196
+ case .restricted:
196
197
  call.resolve(["status": AuthorizationStatusEnum.Restricted.rawValue])
197
- break
198
- case .notDetermined:
198
+ case .notDetermined:
199
199
  call.resolve(["status": AuthorizationStatusEnum.NotDetermined.rawValue])
200
- break
201
200
  @unknown default:
202
201
  call.reject("trackingAuthorizationStatus can't get status")
203
202
  }
@@ -237,6 +236,12 @@ public class AdMobPlugin: CAPPlugin, CAPBridgedPlugin {
237
236
  }
238
237
  }
239
238
 
239
+ @objc func showPrivacyOptionsForm(_ call: CAPPluginCall) {
240
+ DispatchQueue.main.async {
241
+ self.consentExecutor.showPrivacyOptionsForm(call)
242
+ }
243
+ }
244
+
240
245
  @objc func resetConsentInfo(_ call: CAPPluginCall) {
241
246
  DispatchQueue.main.async {
242
247
  self.consentExecutor.resetConsentInfo(call)
@@ -252,11 +257,11 @@ public class AdMobPlugin: CAPPlugin, CAPBridgedPlugin {
252
257
  return adUnitID
253
258
  }
254
259
 
255
- private func GADRequestWithOption(_ npa: Bool) -> GADRequest {
256
- let request = GADRequest()
260
+ private func GADRequestWithOption(_ npa: Bool) -> Request {
261
+ let request = Request()
257
262
 
258
263
  if npa {
259
- let extras = GADExtras()
264
+ let extras = Extras()
260
265
  extras.additionalParameters = ["npa": "1"]
261
266
  request.register(extras)
262
267
  }
@@ -270,30 +275,30 @@ public class AdMobPlugin: CAPPlugin, CAPBridgedPlugin {
270
275
  private func setRequestConfiguration(_ call: CAPPluginCall) {
271
276
 
272
277
  if call.getBool("initializeForTesting") ?? false {
273
- GADMobileAds.sharedInstance().requestConfiguration.testDeviceIdentifiers = call.getArray("testingDevices", String.self) ?? []
278
+ MobileAds.shared.requestConfiguration.testDeviceIdentifiers = call.getArray("testingDevices", String.self) ?? []
274
279
  }
275
280
 
276
281
  if call.getBool("tagForChildDirectedTreatment") == true {
277
- GADMobileAds.sharedInstance().requestConfiguration.tagForChildDirectedTreatment = true
282
+ MobileAds.shared.requestConfiguration.tagForChildDirectedTreatment = true
278
283
  }
279
284
 
280
285
  if call.getBool("tagForUnderAgeOfConsent") == true {
281
- GADMobileAds.sharedInstance().requestConfiguration.tagForUnderAgeOfConsent = true
286
+ MobileAds.shared.requestConfiguration.tagForUnderAgeOfConsent = true
282
287
  }
283
288
 
284
289
  if call.getString("maxAdContentRating") != nil {
285
290
  switch call.getString("maxAdContentRating") {
286
291
  case "General":
287
- GADMobileAds.sharedInstance().requestConfiguration.maxAdContentRating =
292
+ MobileAds.shared.requestConfiguration.maxAdContentRating =
288
293
  GADMaxAdContentRating.general
289
294
  case "ParentalGuidance":
290
- GADMobileAds.sharedInstance().requestConfiguration.maxAdContentRating =
295
+ MobileAds.shared.requestConfiguration.maxAdContentRating =
291
296
  GADMaxAdContentRating.parentalGuidance
292
297
  case "Teen":
293
- GADMobileAds.sharedInstance().requestConfiguration.maxAdContentRating =
298
+ MobileAds.shared.requestConfiguration.maxAdContentRating =
294
299
  GADMaxAdContentRating.teen
295
300
  case "MatureAudience":
296
- GADMobileAds.sharedInstance().requestConfiguration.maxAdContentRating =
301
+ MobileAds.shared.requestConfiguration.maxAdContentRating =
297
302
  GADMaxAdContentRating.matureAudience
298
303
  default:
299
304
  print("maxAdContentRating can't find value")
@@ -2,54 +2,45 @@ import Foundation
2
2
  import Capacitor
3
3
  import GoogleMobileAds
4
4
 
5
- class BannerExecutor: NSObject, GADBannerViewDelegate {
5
+ class BannerExecutor: NSObject, BannerViewDelegate {
6
6
  weak var plugin: AdMobPlugin?
7
- var bannerView: GADBannerView!
7
+ var bannerView: BannerView!
8
+ var adPosition: String = ""
9
+ var Margin: Int = 0
8
10
 
9
- func showBanner(_ call: CAPPluginCall, _ request: GADRequest, _ adUnitID: String) {
11
+ func showBanner(_ call: CAPPluginCall, _ request: Request, _ adUnitID: String) {
10
12
  if let rootViewController = plugin?.getRootVC() {
11
13
 
12
14
  let adSize = call.getString("adSize") ?? "ADAPTIVE_BANNER"
13
15
  let adPosition = call.getString("position") ?? "BOTTOM_CENTER"
14
16
  let adMargin = call.getInt("margin") ?? 0
15
17
 
16
- var bannerSize: GADAdSize
18
+ var bannerSize: AdSize
17
19
 
18
20
  switch adSize {
19
21
  case "BANNER":
20
- bannerSize = GADAdSizeBanner
21
- break
22
- case "LARGE_BANNER":
23
- bannerSize = GADAdSizeLargeBanner
24
- break
25
- case "FULL_BANNER":
26
- bannerSize = GADAdSizeFullBanner
27
- break
28
- case "LEADERBOARD":
29
- bannerSize = GADAdSizeLeaderboard
30
- break
31
- case "MEDIUM_RECTANGLE":
32
- bannerSize = GADAdSizeMediumRectangle
33
- break
34
- case "SMART_BANNER":
22
+ bannerSize = AdSizeBanner
23
+ case "LARGE_BANNER":
24
+ bannerSize = AdSizeLargeBanner
25
+ case "FULL_BANNER":
26
+ bannerSize = AdSizeFullBanner
27
+ case "LEADERBOARD":
28
+ bannerSize = AdSizeLeaderboard
29
+ case "MEDIUM_RECTANGLE":
30
+ bannerSize = AdSizeMediumRectangle
31
+ case "SMART_BANNER":
35
32
  bannerSize = kGADAdSizeSmartBannerPortrait
36
- break
37
- default: // ADAPTIVE_BANNER
33
+ default: // ADAPTIVE_BANNER
38
34
  let frame = { () -> CGRect in
39
35
  // Here safe area is taken into account, hence the view frame is used
40
36
  // after the view has been laid out.
41
- if #available(iOS 11.0, *) {
42
- return rootViewController.view.frame.inset(by: rootViewController.view.safeAreaInsets)
43
- } else {
44
- return rootViewController.view.frame
45
- }
37
+ return rootViewController.view.frame.inset(by: rootViewController.view.safeAreaInsets)
46
38
  }()
47
39
  let viewWidth = frame.size.width
48
- bannerSize = GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(viewWidth)
49
- break
40
+ bannerSize = currentOrientationAnchoredAdaptiveBanner(width: viewWidth)
50
41
  }
51
42
 
52
- self.bannerView = GADBannerView(adSize: bannerSize)
43
+ self.bannerView = BannerView(adSize: bannerSize)
53
44
  self.addBannerViewToView(self.bannerView, adPosition, adMargin)
54
45
  self.bannerView.translatesAutoresizingMaskIntoConstraints = false
55
46
  self.bannerView.adUnitID = adUnitID
@@ -107,21 +98,37 @@ class BannerExecutor: NSObject, GADBannerViewDelegate {
107
98
  call.resolve([:])
108
99
  }
109
100
 
110
- private func addBannerViewToView(_ bannerView: GADBannerView, _ adPosition: String, _ Margin: Int) {
101
+ private func addBannerViewToView(_ bannerView: BannerView, _ adPosition: String, _ Margin: Int) {
111
102
  removeBannerViewToView()
103
+ bannerView.translatesAutoresizingMaskIntoConstraints = false
104
+ bannerView.tag = 2743243288699 // rand
105
+ self.Margin = Margin
106
+ self.adPosition = adPosition
107
+ }
108
+
109
+ private func removeBannerViewToView() {
112
110
  if let rootViewController = plugin?.getRootVC() {
111
+ if let subView = rootViewController.view.viewWithTag(2743243288699) {
112
+ bannerView.delegate = nil
113
+ NSLog("AdMob: find subView")
114
+ subView.removeFromSuperview()
115
+ }
116
+ }
117
+ }
113
118
 
114
- bannerView.translatesAutoresizingMaskIntoConstraints = false
115
- bannerView.tag = 2743243288699 // rand
119
+ /// Tells the delegate an ad request loaded an ad.
120
+ func bannerViewDidReceiveAd(_ bannerView: BannerView) {
121
+ NSLog("bannerViewDidReceiveAd")
122
+ if let rootViewController = plugin?.getRootVC() {
116
123
  rootViewController.view.addSubview(bannerView)
117
124
  rootViewController.view.addConstraints(
118
125
  [NSLayoutConstraint(item: bannerView,
119
- attribute: adPosition == "TOP_CENTER" ? .top : .bottom,
126
+ attribute: self.adPosition == "TOP_CENTER" ? .top : .bottom,
120
127
  relatedBy: .equal,
121
128
  toItem: rootViewController.view.safeAreaLayoutGuide,
122
- attribute: adPosition == "TOP_CENTER" ? .top : .bottom,
129
+ attribute: self.adPosition == "TOP_CENTER" ? .top : .bottom,
123
130
  multiplier: 1,
124
- constant: CGFloat(Int(Margin) * -1)),
131
+ constant: CGFloat(Int(self.Margin) * -1)),
125
132
  NSLayoutConstraint(item: bannerView,
126
133
  attribute: .centerX,
127
134
  relatedBy: .equal,
@@ -130,32 +137,17 @@ class BannerExecutor: NSObject, GADBannerViewDelegate {
130
137
  multiplier: 1,
131
138
  constant: 0)
132
139
  ])
133
- }
134
- }
140
+ self.plugin?.notifyListeners(BannerAdPluginEvents.SizeChanged.rawValue, data: [
141
+ "width": bannerView.frame.width,
142
+ "height": bannerView.frame.height
143
+ ])
144
+ self.plugin?.notifyListeners(BannerAdPluginEvents.Loaded.rawValue, data: [:])
135
145
 
136
- private func removeBannerViewToView() {
137
- if let rootViewController = plugin?.getRootVC() {
138
- if let subView = rootViewController.view.viewWithTag(2743243288699) {
139
- bannerView.delegate = nil
140
- NSLog("AdMob: find subView")
141
- subView.removeFromSuperview()
142
- }
143
146
  }
144
147
  }
145
148
 
146
- /// Tells the delegate an ad request loaded an ad.
147
- func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
148
- NSLog("bannerViewDidReceiveAd")
149
-
150
- self.plugin?.notifyListeners(BannerAdPluginEvents.SizeChanged.rawValue, data: [
151
- "width": bannerView.frame.width,
152
- "height": bannerView.frame.height
153
- ])
154
- self.plugin?.notifyListeners(BannerAdPluginEvents.Loaded.rawValue, data: [:])
155
- }
156
-
157
149
  /// Tells the delegate an ad request failed.
158
- func bannerView(_ bannerView: GADBannerView,
150
+ func bannerView(_ bannerView: BannerView,
159
151
  didFailToReceiveAdWithError error: Error) {
160
152
  NSLog("bannerView:didFailToReceiveAdWithError: \(error.localizedDescription)")
161
153
  self.removeBannerViewToView()
@@ -169,18 +161,18 @@ class BannerExecutor: NSObject, GADBannerViewDelegate {
169
161
  ])
170
162
  }
171
163
 
172
- func bannerViewDidRecordImpression(_ bannerView: GADBannerView) {
164
+ func bannerViewDidRecordImpression(_ bannerView: BannerView) {
173
165
  self.plugin?.notifyListeners(BannerAdPluginEvents.AdImpression.rawValue, data: [:])
174
166
  }
175
167
 
176
168
  /// Tells the delegate that a full-screen view will be presented in response
177
169
  /// to the user clicking on an ad.
178
- func bannerViewWillPresentScreen(_ bannerView: GADBannerView) {
170
+ func bannerViewWillPresentScreen(_ bannerView: BannerView) {
179
171
  self.plugin?.notifyListeners(BannerAdPluginEvents.Opened.rawValue, data: [:])
180
172
  }
181
173
 
182
174
  /// Tells the delegate that the full-screen view will be dismissed.
183
- func bannerViewWillDismissScreen(_ bannerView: GADBannerView) {
175
+ func bannerViewWillDismissScreen(_ bannerView: BannerView) {
184
176
  self.plugin?.notifyListeners(BannerAdPluginEvents.Closed.rawValue, data: [:])
185
177
  }
186
178
  }
@@ -7,78 +7,88 @@ class ConsentExecutor: NSObject {
7
7
  weak var plugin: AdMobPlugin?
8
8
 
9
9
  func requestConsentInfo(_ call: CAPPluginCall, _ debugGeography: Int, _ testDeviceIdentifiers: [String], _ tagForUnderAgeOfConsent: Bool) {
10
- let parameters = UMPRequestParameters()
11
- let debugSettings = UMPDebugSettings()
10
+ let parameters = RequestParameters()
11
+ let debugSettings = DebugSettings()
12
12
 
13
- debugSettings.geography = UMPDebugGeography(rawValue: debugGeography) ?? UMPDebugGeography.disabled
13
+ debugSettings.geography = DebugGeography(rawValue: debugGeography) ?? DebugGeography.disabled
14
14
  debugSettings.testDeviceIdentifiers = testDeviceIdentifiers
15
15
 
16
16
  parameters.debugSettings = debugSettings
17
- parameters.tagForUnderAgeOfConsent = tagForUnderAgeOfConsent
17
+ parameters.isTaggedForUnderAgeOfConsent = tagForUnderAgeOfConsent
18
18
 
19
19
  // Request an update to the consent information.
20
- UMPConsentInformation.sharedInstance.requestConsentInfoUpdate(
20
+ ConsentInformation.shared.requestConsentInfoUpdate(
21
21
  with: parameters,
22
22
  completionHandler: { error in
23
23
  if error != nil {
24
24
  call.reject("Request consent info failed")
25
25
  } else {
26
- call.resolve([
27
- "status": self.getConsentStatusString(UMPConsentInformation.sharedInstance.consentStatus),
28
- "isConsentFormAvailable": UMPConsentInformation.sharedInstance.formStatus == UMPFormStatus.available,
29
- "canShowAds": self.canShowAds(),
30
- "canShowPersonalizedAds": self.canShowPersonalizedAds(),
31
- "isConsentOutdated": self.isConsentOutdated()
32
- ])
26
+ call.resolve(self.getConsentInfoDictionary())
33
27
  }
34
28
  })
35
29
  }
36
30
 
31
+ @MainActor
32
+ func showPrivacyOptionsForm(_ call: CAPPluginCall) {
33
+ guard let rootViewController = plugin?.getRootVC() else {
34
+ return call.reject("No ViewController")
35
+ }
36
+
37
+ Task {
38
+ do {
39
+ try await ConsentForm.presentPrivacyOptionsForm(from: rootViewController)
40
+ call.resolve()
41
+ } catch {
42
+ call.reject("Failed to show privacy options form: \(error.localizedDescription)")
43
+ }
44
+ }
45
+ }
46
+
47
+ @MainActor
37
48
  func showConsentForm(_ call: CAPPluginCall) {
38
- if let rootViewController = plugin?.getRootVC() {
39
- let formStatus = UMPConsentInformation.sharedInstance.formStatus
40
-
41
- if formStatus == UMPFormStatus.available {
42
- UMPConsentForm.load(completionHandler: {form, loadError in
43
- if loadError != nil {
44
- call.reject(loadError?.localizedDescription ?? "Load consent form error")
45
- return
46
- }
47
-
48
- form?.present(from: rootViewController, completionHandler: { dismissError in
49
- if dismissError != nil {
50
- call.reject(dismissError?.localizedDescription ?? "Consent dismiss error")
51
- return
52
- }
53
-
54
- call.resolve([
55
- "status": self.getConsentStatusString(UMPConsentInformation.sharedInstance.consentStatus),
56
- "canShowAds": self.canShowAds(),
57
- "canShowPersonalizedAds": self.canShowPersonalizedAds(),
58
- "isConsentOutdated": self.isConsentOutdated()
59
- ])
60
- })
61
- })
62
- } else {
63
- call.reject("Consent Form not available")
49
+ guard let rootViewController = plugin?.getRootVC() else {
50
+ return call.reject("No ViewController")
51
+ }
52
+
53
+ guard ConsentInformation.shared.formStatus == FormStatus.available else {
54
+ return call.reject("Consent Form not available")
55
+ }
56
+
57
+ Task {
58
+ do {
59
+ let form = try await ConsentForm.load()
60
+ try await form.present(from: rootViewController)
61
+ call.resolve(getConsentInfoDictionary())
62
+ } catch {
63
+ call.reject("Request consent info failed")
64
64
  }
65
- } else {
66
- call.reject("No ViewController")
67
65
  }
68
66
  }
69
67
 
70
68
  func resetConsentInfo(_ call: CAPPluginCall) {
71
- UMPConsentInformation.sharedInstance.reset()
69
+ ConsentInformation.shared.reset()
72
70
  call.resolve()
73
71
  }
74
72
 
75
- func getConsentStatusString(_ consentStatus: UMPConsentStatus) -> String {
73
+ private func getConsentInfoDictionary() -> [String: Any] {
74
+ return [
75
+ "status": getConsentStatusString(ConsentInformation.shared.consentStatus),
76
+ "isConsentFormAvailable": ConsentInformation.shared.formStatus == FormStatus.available,
77
+ "canRequestAds": ConsentInformation.shared.canRequestAds,
78
+ "privacyOptionsRequirementStatus": getPrivacyOptionsRequirementStatus(ConsentInformation.shared.privacyOptionsRequirementStatus),
79
+ "canShowAds": canShowAds(),
80
+ "canShowPersonalizedAds": canShowPersonalizedAds(),
81
+ "isConsentOutdated": isConsentOutdated()
82
+ ]
83
+ }
84
+
85
+ func getConsentStatusString(_ consentStatus: ConsentStatus) -> String {
76
86
  switch consentStatus {
77
- case UMPConsentStatus.required:
87
+ case ConsentStatus.required:
78
88
  return "REQUIRED"
79
- case UMPConsentStatus.notRequired:
89
+ case ConsentStatus.notRequired:
80
90
  return "NOT_REQUIRED"
81
- case UMPConsentStatus.obtained:
91
+ case ConsentStatus.obtained:
82
92
  return "OBTAINED"
83
93
  default:
84
94
  return "UNKNOWN"
@@ -185,4 +195,14 @@ class ConsentExecutor: NSObject {
185
195
 
186
196
  return false
187
197
  }
198
+ func getPrivacyOptionsRequirementStatus(_ requirementStatus: PrivacyOptionsRequirementStatus) -> String {
199
+ switch requirementStatus {
200
+ case PrivacyOptionsRequirementStatus.required:
201
+ return "REQUIRED"
202
+ case PrivacyOptionsRequirementStatus.notRequired:
203
+ return "NOT_REQUIRED"
204
+ default:
205
+ return "UNKNOWN"
206
+ }
207
+ }
188
208
  }
@@ -2,13 +2,13 @@ import Foundation
2
2
  import Capacitor
3
3
  import GoogleMobileAds
4
4
 
5
- class AdInterstitialExecutor: NSObject, GADFullScreenContentDelegate {
5
+ class AdInterstitialExecutor: NSObject, FullScreenContentDelegate {
6
6
  weak var plugin: AdMobPlugin?
7
- var interstitial: GADInterstitialAd!
7
+ var interstitial: InterstitialAd!
8
8
 
9
- func prepareInterstitial(_ call: CAPPluginCall, _ request: GADRequest, _ adUnitID: String) {
10
- GADInterstitialAd.load(
11
- withAdUnitID: adUnitID,
9
+ func prepareInterstitial(_ call: CAPPluginCall, _ request: Request, _ adUnitID: String) {
10
+ InterstitialAd.load(
11
+ with: adUnitID,
12
12
  request: request,
13
13
  completionHandler: { (ad, error) in
14
14
  if let error = error {
@@ -36,7 +36,7 @@ class AdInterstitialExecutor: NSObject, GADFullScreenContentDelegate {
36
36
  func showInterstitial(_ call: CAPPluginCall) {
37
37
  if let rootViewController = plugin?.getRootVC() {
38
38
  if let ad = self.interstitial {
39
- ad.present(fromRootViewController: rootViewController)
39
+ ad.present(from: rootViewController)
40
40
  call.resolve([:])
41
41
  } else {
42
42
  NSLog("Ad wasn't ready")
@@ -45,7 +45,7 @@ class AdInterstitialExecutor: NSObject, GADFullScreenContentDelegate {
45
45
  }
46
46
  }
47
47
 
48
- func ad(_ ad: GADFullScreenPresentingAd, didFailToPresentFullScreenContentWithError error: Error) {
48
+ func ad(_ ad: FullScreenPresentingAd, didFailToPresentFullScreenContentWithError error: Error) {
49
49
  NSLog("InterstitialFullScreenDelegate Ad failed to present full screen content with error \(error.localizedDescription).")
50
50
  self.plugin?.notifyListeners(InterstitialAdPluginEvents.FailedToShow.rawValue, data: [
51
51
  "code": 0,
@@ -53,12 +53,12 @@ class AdInterstitialExecutor: NSObject, GADFullScreenContentDelegate {
53
53
  ])
54
54
  }
55
55
 
56
- func adWillPresentFullScreenContent(_ ad: GADFullScreenPresentingAd) {
56
+ func adWillPresentFullScreenContent(_ ad: FullScreenPresentingAd) {
57
57
  NSLog("InterstitialFullScreenDelegate Ad did present full screen content.")
58
58
  self.plugin?.notifyListeners(InterstitialAdPluginEvents.Showed.rawValue, data: [:])
59
59
  }
60
60
 
61
- func adDidDismissFullScreenContent(_ ad: GADFullScreenPresentingAd) {
61
+ func adDidDismissFullScreenContent(_ ad: FullScreenPresentingAd) {
62
62
  NSLog("InterstitialFullScreenDelegate Ad did dismiss full screen content.")
63
63
  self.plugin?.notifyListeners(InterstitialAdPluginEvents.Dismissed.rawValue, data: [:])
64
64
  }