react-navigation.github.io icon indicating copy to clipboard operation
react-navigation.github.io copied to clipboard

Question: Missing instructions for react-native-screens installation in iOS?

Open santitopo opened this issue 2 years ago • 4 comments

Current behavior

Hi! Looking at the react-native-screens installation guide for iOS, I see there is one extra step to properly set it up, which includes adding some handlers to the AppDeletegate.mm to start listening for orientation notifications. However, this step is not documented in the react-navigation docs.

Considering react-navigation depends on react-native-screens, I was wondering whether this is something we should add to our app as well.

Link to the installation guide: https://github.com/software-mansion/react-native-screens#ios

Expected behavior

Either clarifying in the react-navigation docs that this step is not necessary, or adding it as part of the installation process in the docs.

Reproduction

https://github.com/software-mansion/react-native-screens#ios

Platform

  • [ ] Android
  • [X] iOS
  • [ ] Web
  • [ ] Windows
  • [ ] MacOS

Packages

  • [ ] @react-navigation/​bottom-tabs
  • [ ] @react-navigation/​drawer
  • [ ] @react-navigation/​material-bottom-tabs
  • [ ] @react-navigation/​material-top-tabs
  • [X] @react-navigation/​stack
  • [ ] @react-navigation/​native-stack

Environment

  • [x] I've removed the packages that I don't use
package version
@react-navigation/native 6.0.11
@react-navigation/native-stack 6.7.0
react-native-safe-area-context 4.3.1
react-native-screens 3.17.0
react-native-gesture-handler 2.5.0
react-native-reanimated 2.9.1
react-native 0.69
node 16.10.0
npm or yarn 7.24.0

santitopo avatar Sep 16 '22 15:09 santitopo

Hey! Thanks for opening the issue. The issue doesn't seem to contain a link to a repro (a snack.expo.dev link, a www.typescriptlang.org/play link or link to a GitHub repo under your username).

Can you provide a minimal repro which demonstrates the issue? Please try to keep the repro as small as possible and make sure that we can run it without additional setup.

A repro will help us debug the issue. The issue will be closed automatically after a while if you don't provide a repro.

github-actions[bot] avatar Sep 16 '22 15:09 github-actions[bot]

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

  • @react-navigation/native (found: 6.0.11, latest: 6.0.12)

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

github-actions[bot] avatar Sep 16 '22 15:09 github-actions[bot]

cc @kacperkapusciak

satya164 avatar Sep 16 '22 15:09 satya164

Hey @santitopo 👋

It's complicated.

UIKit's documentation clearly states that calling beginGeneratingDeviceOrientationNotifications is required for orientation to properly work but we didn't have this anywhere in our codebase and it worked either way for months (years?).

Recently, someone reported an issue that calling this method is indeed required in his application to work correctly. Adding this to AppDelegate is an intermediate that anyone can do without a new version of screens but I hope it's possible to have this step done internally in rn-screens instead.

kacperkapusciak avatar Sep 19 '22 13:09 kacperkapusciak

Fixed in https://github.com/software-mansion/react-native-screens/pull/1596

kacperkapusciak avatar Dec 05 '22 10:12 kacperkapusciak