Skip to content

[interactive_media_ads] Adds remaining methods for internal wrapper of the native AdsRequest #9663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jul 29, 2025

Conversation

bparrishMines
Copy link
Contributor

@bparrishMines bparrishMines commented Jul 22, 2025

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively expands the AdsRequest API for both Android and iOS, providing more control over ad requests. The changes are well-implemented across Dart, Kotlin, and Swift, with corresponding updates to Pigeon definitions and comprehensive tests. The upgrade to a newer Pigeon version also introduces beneficial changes for testability. I have one minor suggestion to improve the robustness of the Swift implementation by replacing a force cast with a safer conditional cast. I've referenced the Flutter style guide in my review comment.

Comment on lines +104 to +105
throw (pigeonApi.pigeonRegistrar.apiDelegate as! ProxyApiDelegate)
.createConstructorNullError(type: URL.Type.self, parameters: ["string": contentURL])

Choose a reason for hiding this comment

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

medium

Using a force cast as! can lead to a runtime crash if the type cast fails. For better robustness and maintainability, it's recommended to use a conditional cast as? with a guard statement to safely unwrap the delegate.

        guard let proxyApiDelegate = pigeonApi.pigeonRegistrar.apiDelegate as? ProxyApiDelegate else {
          throw PigeonError(
            code: "cast-error",
            message: "apiDelegate is not of type ProxyApiDelegate.",
            details: nil)
        }
        throw proxyApiDelegate.createConstructorNullError(
          type: URL.Type.self, parameters: ["string": contentURL])

@bparrishMines bparrishMines changed the title Native ads request [interactive_media_ads] Adds remaining methods for internal wrapper of the native AdsRequest Jul 24, 2025
@bparrishMines bparrishMines marked this pull request as ready for review July 28, 2025 18:03
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

LGTM

@bparrishMines bparrishMines added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 29, 2025
@auto-submit auto-submit bot merged commit 2755aa3 into flutter:main Jul 29, 2025
80 checks passed
@bparrishMines bparrishMines deleted the native_ads_request branch July 29, 2025 01:45
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 29, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 29, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Jul 29, 2025
flutter/packages@6b2e34e...ed235d1

2025-07-29 [email protected] Roll Flutter from
cfbaa18 to 46b097a (12 revisions) (flutter/packages#9695)
2025-07-29 [email protected] [camera_avfoundation]
Implementation swift migration - part 10 (flutter/packages#9664)
2025-07-29 [email protected]
[interactive_media_ads] Adds remaining methods for internal wrapper of
the native `AdsRequest` (flutter/packages#9663)
2025-07-28 [email protected]
[camera_android_camerax] Delete unused file (flutter/packages#9634)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
vashworth pushed a commit to vashworth/packages that referenced this pull request Jul 30, 2025
…f the native `AdsRequest` (flutter#9663)

## Pre-Review Checklist

**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: interactive_media_ads Plugin for IMA SDK platform-android platform-ios
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants