Skip to content

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

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Ima ad ios #9785

wants to merge 10 commits into from

Conversation

bparrishMines
Copy link
Contributor

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

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 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.

Comment on lines 86 to 88
// func adPodInfo(pigeonApi: PigeonApiIMAAd, pigeonInstance: IMAAd) throws -> IMAAdPodInfo {
// return pigeonInstance.adPodInfo
// }

Choose a reason for hiding this comment

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

critical

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.

Suggested change
// func adPodInfo(pigeonApi: PigeonApiIMAAd, pigeonInstance: IMAAd) throws -> IMAAdPodInfo {
// return pigeonInstance.adPodInfo
// }
func adPodInfo(pigeonApi: PigeonApiIMAAd, pigeonInstance: IMAAd) throws -> IMAAdPodInfo {
return pigeonInstance.adPodInfo
}

Comment on lines 102 to 104
// func universalAdIDs(pigeonApi: PigeonApiIMAAd, pigeonInstance: IMAAd) throws -> [IMAUniversalAdID] {
// return pigeonInstance.universalAdIDs
// }

Choose a reason for hiding this comment

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

critical

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.

Suggested change
// func universalAdIDs(pigeonApi: PigeonApiIMAAd, pigeonInstance: IMAAd) throws -> [IMAUniversalAdID] {
// return pigeonInstance.universalAdIDs
// }
func universalAdIDs(pigeonApi: PigeonApiIMAAd, pigeonInstance: IMAAd) throws -> [IMAUniversalAdID] {
return pigeonInstance.universalAdIDs
}

Comment on lines 52 to 60
// 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)
// }

Choose a reason for hiding this comment

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

medium

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.

Suggested change
// 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)
}

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

Successfully merging this pull request may close these issues.

1 participant