-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Ima ad ios #9785
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
base: main
Are you sure you want to change the base?
Ima ad ios #9785
Conversation
There was a problem hiding this 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 adds internal wrappers for the iOS native IMAAd
and IMAUniversalAdID
classes, which is a good step forward. The changes include new pigeon definitions, generated code for Dart and Swift, native delegate implementations, and new tests.
However, there are a few critical issues to address:
- The pull request description is the default template and hasn't been filled out. Please update it to describe the changes and link to the relevant issue(s), as required by the contributor guide.
- There are inconsistencies in the implementation. Some delegate methods in
AdProxyAPIDelegate.swift
are commented out, but the generated code calls them with force unwrapping (try!
), which will lead to a runtime crash. - A test case for companion ads is commented out in
AdProxyAPITests.swift
, which should be enabled to ensure full test coverage for the newly supported feature.
Please address these points to ensure the stability and completeness of the changes.
// func adPodInfo(pigeonApi: PigeonApiIMAAd, pigeonInstance: IMAAd) throws -> IMAAdPodInfo { | ||
// return pigeonInstance.adPodInfo | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is commented out, but the generated pigeon code in InteractiveMediaAdsLibrary.g.swift
calls it using try!
. This will cause a runtime crash when a new IMAAd
instance is created. Please uncomment and implement this method.
// func adPodInfo(pigeonApi: PigeonApiIMAAd, pigeonInstance: IMAAd) throws -> IMAAdPodInfo { | |
// return pigeonInstance.adPodInfo | |
// } | |
func adPodInfo(pigeonApi: PigeonApiIMAAd, pigeonInstance: IMAAd) throws -> IMAAdPodInfo { | |
return pigeonInstance.adPodInfo | |
} |
// func universalAdIDs(pigeonApi: PigeonApiIMAAd, pigeonInstance: IMAAd) throws -> [IMAUniversalAdID] { | ||
// return pigeonInstance.universalAdIDs | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is commented out, but the generated pigeon code in InteractiveMediaAdsLibrary.g.swift
calls it using try!
. This will cause a runtime crash when a new IMAAd
instance is created. Please uncomment and implement this method.
// func universalAdIDs(pigeonApi: PigeonApiIMAAd, pigeonInstance: IMAAd) throws -> [IMAUniversalAdID] { | |
// return pigeonInstance.universalAdIDs | |
// } | |
func universalAdIDs(pigeonApi: PigeonApiIMAAd, pigeonInstance: IMAAd) throws -> [IMAUniversalAdID] { | |
return pigeonInstance.universalAdIDs | |
} |
// func testCompanionAds() { | ||
// let registrar = TestProxyApiRegistrar() | ||
// let api = registrar.apiDelegate.pigeonApiIMAAd(registrar) | ||
// | ||
// let instance = TestAd.customInit() | ||
// let value = try? api.pigeonDelegate.companionAds(pigeonApi: api, pigeonInstance: instance) | ||
// | ||
// XCTAssertEqual(value, instance.companionAds) | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test case for companionAds
is commented out. Since the README.md
has been updated to remove companion ads from the list of unsupported features, this test should be enabled to ensure the functionality is correctly implemented and verified.
// func testCompanionAds() { | |
// let registrar = TestProxyApiRegistrar() | |
// let api = registrar.apiDelegate.pigeonApiIMAAd(registrar) | |
// | |
// let instance = TestAd.customInit() | |
// let value = try? api.pigeonDelegate.companionAds(pigeonApi: api, pigeonInstance: instance) | |
// | |
// XCTAssertEqual(value, instance.companionAds) | |
// } | |
func testCompanionAds() { | |
let registrar = TestProxyApiRegistrar() | |
let api = registrar.apiDelegate.pigeonApiIMAAd(registrar) | |
let instance = TestAd.customInit() | |
let value = try? api.pigeonDelegate.companionAds(pigeonApi: api, pigeonInstance: instance) | |
XCTAssertEqual(value, instance.companionAds) | |
} |
Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.
List which issues are fixed by this PR. You must list at least one issue.
Pre-Review Checklist
[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///
).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
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