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

fix: iOS crash when scenes are enabled #995

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kononenkoAnton
Copy link

Fixes #...

Description

iOS crashes when presenting a view controller while the application is using scenes: https://developer.apple.com/documentation/uikit/app_and_environment/scenes/
The issue occurs because each scene has its own window.

UIViewController *presentingViewController = appDelegate.window.rootViewController.view.window ? appDelegate.window.rootViewController : appDelegate.window.rootViewController.presentedViewController;

presentingViewController returns nil
IMG_7244

Steps to verify

  1. Prepare an application where scenes are enabled: https://developer.apple.com/documentation/uikit/app_and_environment/scenes/specifying_the_scenes_your_app_supports#3262273
  2. On the RN side, call authorize from "react-native-app-auth"

Copy link

changeset-bot bot commented Jun 25, 2024

🦋 Changeset detected

Latest commit: 773b378

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
react-native-app-auth Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jun 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-app-auth ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 24, 2024 6:26pm

@zibs
Copy link
Contributor

zibs commented Jul 16, 2024

Hey @kononenkoAnton thanks for the PR!

This does seem like it works, but do you think you could provide us with a really stripped down minimal example repo of a RN app that supports scenes as you mentioned.

I haven't used this before and have something clunky set up locally, but would love a reproducible app we could look at/test against in the future.

Let me know, thanks!

@zibs
Copy link
Contributor

zibs commented Jul 23, 2024

Hey @kononenkoAnton - just wanted to give you a friendly ping to see if you'd be up for providing a repro here!

@zibs
Copy link
Contributor

zibs commented Jul 29, 2024

Hey @kononenkoAnton I've been running the https://github.com/microsoft/react-native-test-app without your fix, and it seems like it works correctly still. The RNTA (react-native-test-app) has multiple window support enabled by default and seemed like a good place to test this.

I'm wondering if this might be an issue with your set up instead of an issue with the library.

Let me know if you think you can provide a stripped down example of your implementation, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants