Skip to content

feat: support for App Open Ad en Android e iOS - fix comments#422

Merged
distante merged 40 commits intocapacitor-community:mainfrom
yarivgdidi:app-open-ad-review-fixes
Apr 10, 2026
Merged

feat: support for App Open Ad en Android e iOS - fix comments#422
distante merged 40 commits intocapacitor-community:mainfrom
yarivgdidi:app-open-ad-review-fixes

Conversation

@yarivgdidi
Copy link
Copy Markdown
Contributor

No description provided.

yarivgdidi and others added 27 commits March 19, 2026 21:25
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
Replace any type with proper AppOpenAdOptions type for better type safety and API consistency.
Moved AppOpenAd Plugin initialization inside the AdMob class.
…/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>
@yarivgdidi yarivgdidi changed the title App open ad review fixes feat: support for App Open Ad en Android e iOS - fix comments Mar 19, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Copy Markdown
Contributor

@distante distante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: 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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

yarivgdidi and others added 2 commits April 8, 2026 20:48
- 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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@distante
Copy link
Copy Markdown
Contributor

distante commented Apr 9, 2026

yarivgdidi and others added 2 commits April 9, 2026 16:53
- 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>
@yarivgdidi
Copy link
Copy Markdown
Contributor Author

Restored createAppOpenOptions, APP_OPEN_TESTER_ID, and all 6 tests in commit 182330b. They were accidentally removed when addressing a Copilot comment — apologies for the confusion.

@yarivgdidi
Copy link
Copy Markdown
Contributor Author

yarivgdidi commented Apr 9, 2026

@distante, sorry for the tests
Claude code sometimes goes to far
restored

…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>
Copy link
Copy Markdown
Contributor

@distante distante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks I will merge this

@distante distante merged commit 6946bfb into capacitor-community:main Apr 10, 2026
5 checks passed
@distante
Copy link
Copy Markdown
Contributor

@rdlabo FYI

@yarivgdidi
Copy link
Copy Markdown
Contributor Author

@distante
Thanks for supporting this.
I see the merge but no version update (still 8.0.0)
the npm package also not updated

@distante
Copy link
Copy Markdown
Contributor

@yarivgdidi the one with rights to deploy is @rdlabo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants