feat: support for App Open Ad en Android e iOS - fix comments#422
feat: support for App Open Ad en Android e iOS - fix comments#422distante merged 40 commits intocapacitor-community:mainfrom
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
no single line ifs please
this should be inside the AdMob class.
comments in English.
no single line ifs please
comments in English
Replace any type with proper AppOpenAdOptions type for better type safety and API consistency.
Moved AppOpenAd Plugin initialization inside the AdMob class.
delete comment
test appOpen
…/AppOpenAdPlugin.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fix failing Android test: stub runOnUiThread to execute runnable synchronously so bannerExecutor.initialize() is verified correctly - Fix README: use adId (not adUnitId) in AppOpenAdOptions example and table, fix grammar "Load an App Open ad", remove extra leading blank line - Fix iOS: clear callback closures after invoking them in delegate methods to avoid unintended retention of CAPPluginCall and notifier references Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
distante
left a comment
There was a problem hiding this comment.
So finally I had some time to check the code. While the construction differs from how the other kind of Ads are build, the main problem currently is that the errors are just eaten by the plugin and not passed to the consumer. This will lead to people creating issues here for things that are not handled by the plugin but by AdMob itself.
Please pass the errors from the Native layer to the browser.
Also let the LLM or Android Studio convert the code from java to Kotlin.
Thanks for the PR!
android/src/main/java/com/getcapacitor/community/admob/appopen/AppOpenAdPlugin.java
Outdated
Show resolved
Hide resolved
android/src/main/java/com/getcapacitor/community/admob/appopen/AppOpenAdPlugin.java
Outdated
Show resolved
Hide resolved
- Android: add AppOpenAdPluginEvents.kt enum, replace magic strings - Android: pass AdMobPluginError with code/message on failure events - Android: propagate LoadAdError/AdError from manager through callbacks - iOS: propagate Error through onFailed/onFailedToShow callbacks - iOS: include code and message in failure event notifications Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
android/src/main/java/com/getcapacitor/community/admob/models/AdOptions.java
Show resolved
Hide resolved
- Fix initialization to properly chain promises (wait for AdMob.initialize before calling other methods), preventing demo app crash - Move App Open Ad from app.component to home page with load/show buttons, matching the pattern of other ad types (interstitial, reward) - Add App Open Ad section to demo UI with event listeners - Add App Open screenshots (iOS + Android) to README - Fix AppOpenAdPluginEvents.kt: use const val instead of override val to fix Java interop (private access error) - Use Google test ad ID for App Open (ca-app-pub-3940256099942544/5575463023) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add per-event typed addListener overloads to AppOpenAdPlugin interface, matching the pattern in InterstitialDefinitions (FailedToLoad/FailedToShow receive AdMobError, others receive void) - iOS: check isAdLoaded() before attempting to show, giving a specific "App Open Ad is not loaded" rejection instead of a generic error - Remove unused createAppOpenOptions/APP_OPEN_TESTER_ID from AdOptions and their corresponding tests (App Open reads adId directly from call) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 22 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add error parameter to FailedToLoad/FailedToShow listener examples in README to match typed API (AdMobError) - Remove unused rootViewController parameter from iOS loadAd method Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@yarivgdidi what happened with the tests? ff6eea6#diff-ce3f6b7ca8731f9babda30ed293b9135ef12b0b452b0ce52c01bf9c8a142463c |
- iOS: add AppOpenAdPluginEvents enum (matching other ad types pattern), replace hardcoded event strings with enum rawValues - iOS: remove unused getRootViewController param from loadAppOpen - iOS/Android: include adUnitId in Loaded event and resolve response, matching interstitial/reward behavior - Android: use runOnMain() helper consistently in showAppOpen Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Reverts the removal of AdOptionsFactory.createAppOpenOptions() and APP_OPEN_TESTER_ID, along with their corresponding tests. These were removed per a Copilot suggestion but the maintainer wants them kept for consistency with other ad types. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Restored |
|
@distante, sorry for the tests |
…otlin Convert both App Open Ad files to idiomatic Kotlin per reviewer request. Uses Kotlin features: named parameters, apply blocks, null safety, fun interface, property accessors, and lambda syntax. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
distante
left a comment
There was a problem hiding this comment.
Thanks I will merge this
|
@rdlabo FYI |
|
@distante |
|
@yarivgdidi the one with rights to deploy is @rdlabo |
No description provided.