Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
dluksza wants to merge 1 commit into stripe:master
base: master
Choose a base branch
Loading
from dluksza:fix_attempt_to_present_view_not_in_hierarchy

Conversation

@dluksza
Copy link

@dluksza dluksza commented Sep 20, 2024

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 (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 isKeyWindow set to true.

Testing

  • I tested this manually
  • I added automated tests

Documentation

Select one:

  • I have added relevant documentation for my changes.
  • This PR does not result in any developer-facing changes.

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>
Copy link

CLAassistant commented Sep 20, 2024
edited
Loading

CLA assistant check
All committers have signed the CLA.

Copy link

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.

Copy link

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

Copy link

Could we please get an update on this merge? @charliecruzan-stripe @jonasbark

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

Reviewers

@jonasbark jonasbark jonasbark approved these changes

@charliecruzan-stripe charliecruzan-stripe Awaiting requested review from charliecruzan-stripe

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /