-
Notifications
You must be signed in to change notification settings - Fork 301
fix: Finding main view controller on iOS #1736
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
fix: Finding main view controller on iOS #1736
Conversation
In a situation when `rootViewController` is not set by the application, the main view controller is not found, resulting in error: Attempt to present <STP_Internal_BottomSheetViewController> on <UIViewController> (from <UIViewController>) whose view is not in the window hierarchy. which then prevents the Stripe bottom sheet from showing. Blocking the payment flow. To prevent this, a fallback is added to traverse the windows hierarchy and find the first one that has `isKeyWindow` set to `true`. Co-authored-by: Bruno Pastre <bruno.pastre@onefootball.com>
CLA assistant check
All committers have signed the CLA.
DaveMiller-Stadion
commented
Sep 24, 2024
Very good catch @dluksza, hopefully we can go back to a release version of stripe before we launch the marketplace for OneFootball and 11TeamSports end of next month.
pastre
commented
Oct 2, 2024
hey @charliecruzan-stripe, what are we missing to get this in? Sorry to bother, but we're happy to make any changes requested and go back to use Stripe from trunk :D
DavidMiller-1F
commented
Jan 24, 2025
Could we please get an update on this merge? @charliecruzan-stripe @jonasbark
In a situation when
rootViewControlleris not set by the application, the main view controller is not found, resulting in error:Attempt to present <STP_Internal_BottomSheetViewController> on (from ) whose view is not in the window hierarchy.
which then prevents the Stripe bottom sheet from showing. Blocking the payment flow.
To prevent this, a fallback is added to traverse the windows hierarchy and find the first one that has
isKeyWindowset totrue.Testing
Documentation
Select one: