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

iOS: isApplePaySupported initial state should be null when using useApplePay hook #496

Closed
matthewmorgan opened this issue Aug 5, 2021 · 0 comments · Fixed by #513
Closed
Labels
enhancement New feature or request need triage

Comments

@matthewmorgan
Copy link

matthewmorgan commented Aug 5, 2021

Is your feature request related to a problem? Please describe.
As a developer, I would like to lay out my UI differently if I know Apple Pay is not supported, as opposed to when I am waiting to find out.

Describe the solution you'd like
Ideally, the isApplePaySupported field would be null, and updated to false or true when support status is known. Apple's HID guidelines state that

  1. you should not show the Apple Pay button if the device doesn't support the payment method
  2. you should render the Apple Pay button first, before other payment methods (EG a button to use Stripe's CardField.)

If the initial state were null, it would be possible to render EG an activity indicator until the state is resolved, then rendering the Apple Pay button (or not) along with the others, instead of having the UI reflow.

Describe alternatives you've considered
Laying out space for the Apple Pay button that starts blank, and stays blank unless isApplePaySupported resolves to true? But this sort of dictates a vertically stacked array of buttons, with unused whitespace, so not awesome.

Additional context
Thanks for reading!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request need triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants