Skip to content
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

[UMP] Convert to Future-based API instead of callbacks #852

Open
Reprevise opened this issue May 23, 2023 · 5 comments
Open

[UMP] Convert to Future-based API instead of callbacks #852

Reprevise opened this issue May 23, 2023 · 5 comments
Labels
e3-weeks Effort: < 4 weeks feature request Feature request covers a product enhancement flutter Issues related to flutter p3-low

Comments

@Reprevise
Copy link

Use case

Currently, I'm using Completers to get close to resembling a Future-based API but this should really be converted to using Futures. Success/failure callbacks are very java-y and don't work well in Dart.

Proposal

A new package hit stable called flutter_funding_choices and I believe great inspiration can be taken from that.

ConsentForm#loadConsentForm return type should be a Future<ConsentForm> which throws an error. I understand the attempt to force the user to handle the FormError but I believe this is more of a language problem and not having a Result type class to handle success/error states.

ConsentInformation#requestConsentInfoUpdate return type should be Future<ConsentStatus> and should throw an exception (maybe a GoogleMobileAds specific exception like a new GoogleMobileAdsException class?).

ConsentForm#show should drop the onConsentFormDismissedListener param as well, and should just throw an exception. If you want users to be able to wait for the form to be dismissed, perhaps make it a Future<void> return type.

@huycozy huycozy added in triage Issue currently being evaluated p3-low e3-weeks Effort: < 4 weeks flutter Issues related to flutter proposal Proposal for a change and removed in triage Issue currently being evaluated labels May 25, 2023
@huycozy
Copy link
Collaborator

huycozy commented Jul 21, 2023

We’re closing this issue due to inactivity. If you’re still impacted, please create a new issue via the Developer Forum.

@huycozy huycozy closed this as not planned Won't fix, can't repro, duplicate, stale Jul 21, 2023
@Reprevise
Copy link
Author

@huycozy Can this issue be re-opened? I created a post on the forum on July 21st and haven't gotten a response, and my other feature request issue is open.

@huycozy
Copy link
Collaborator

huycozy commented Nov 3, 2023

Yes. Re-opening the issue for further updates.

@malandr2
Copy link
Collaborator

@Reprevise take a look at #852 and feel free to leave any comments

@Reprevise
Copy link
Author

@Reprevise take a look at #852 and feel free to leave any comments

I'd love to see an update to the requestConsentInfoUpdate method and to the loadConsentForm method (regardless of the new consent form method introduced in that PR) but I do recognize they would be breaking changes.

@malandr2 malandr2 added feature request Feature request covers a product enhancement and removed proposal Proposal for a change labels May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e3-weeks Effort: < 4 weeks feature request Feature request covers a product enhancement flutter Issues related to flutter p3-low
Projects
None yet
Development

No branches or pull requests

3 participants