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

Wrong value for iPhone 14 Pro with dynamic island #47

Open
simonkarmy opened this issue Oct 30, 2022 · 4 comments
Open

Wrong value for iPhone 14 Pro with dynamic island #47

simonkarmy opened this issue Oct 30, 2022 · 4 comments

Comments

@simonkarmy
Copy link

simonkarmy commented Oct 30, 2022

On iPhone 14 pro with "Dynamic Island" it returns 20 while I think it should be the same as iPhone 12 47

@asapMaki
Copy link

Hi @simonkarmy, add this to react-native-status-bar-height/index.js, and use patch package
npx patch-package react-native-status-bar-height

const IP14MAX_WIDTH = 430;
const IP14MAX_HEIGHT = 932;

...

if (W_WIDTH === IP14MAX_WIDTH && W_HEIGHT === IP14MAX_HEIGHT) {
      isIPhoneWithMonobrow_v = true;
      isIPhoneX_v = true;
      statusBarHeight = STATUSBAR_X_HEIGHT;
  }

image

@simonkarmy
Copy link
Author

Thanks @asapMaki
Found it also useful for others to mention that the problem also needs to be fixed for iPhone 14 Pro not only the 14 Pro Max
Here is the numbers for it

const IP14_WIDTH = 393;
const IP14_HEIGHT = 852;

And apply the same check above

@asapMaki
Copy link

asapMaki commented Nov 5, 2022

@simonkarmy glad to hear it helped

@devym-37
Copy link

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

No branches or pull requests

3 participants