-
Notifications
You must be signed in to change notification settings - Fork 134
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
Simplify Android #288
Comments
Hi @kristoffer-zliide, thank you for your thorough analysis. You bring up great points. [As a side thought, I'm less confident that "advanced" is an appropriate way to describe the alternative, more customizable integration path. Something to consider] Similar concerns and ideas were discussed during assessment and code change efforts. See #282 if you prefer to check out the conclusions, and #274 contains a brief API design assessment. Feel free to comment with further suggestions and proposals.
I'm curious to know more about how your proposal behaves against the re-creation events explored above. If the subscription is adequately recreated before results are returned, when destroyed in the middle of the payment process (after showing the pay sheet, and before a result is returned), we should consider being more lax and reduce ties to the widget's lifecycle. Let me know if that makes sense. |
We have our own button that launches the payment sheets, "advanced" usage I suppose. We're updating from v.2 to v.3, and wondering how to deal with the changes. Our v.2 code looks like this:
From what we understand, we need to change it to this on Android:
Is that correct, or are we still missing something?
If it is indeed correct, why wasn't this just rolled into the package like this, so users of the package won't have to deal with it?
The PR related to the changes indicates that the main activity risks being destroyed during the payment flow. Can that really happen?? Or are we seeing ghosts? Google Pay is just a sheet, the activity hosting Flutter is visible behind it, so I'd be very surprised if Android would dispose of it. We are unable to recreate such behavior by enabling "Don't keep activities" in "Developer options". How do you test it?
And even if the activity is destroyed, are these changes enough? Wouldn't we need to also listen for events again after the activity is recreated, e.g. at app startup? I suspect that the solution with subscribing in
initState
won't work unless the button is on the app's first page. This might not just be an issue for "advanced" usage.The text was updated successfully, but these errors were encountered: