react-native-iphone-x-helper
react-native-iphone-x-helper copied to clipboard
iPhone 12 Pro Max not being recognized
Issue
We have an app that has support for all iPhone sizes, and we use the plug in to set a consistent marginTop
layout from the notch on one of our UI components.
How to reproduce
- Install npm package on a
create-react-native-app
project. -
console.log(isIphoneX())
onApp.js
. - Run a new iPhone 12 Pro Max simulator.
- console output is always
false
.
Seeing the same thing + 1
Are you using the latest 1.3.0?
Are you using the latest 1.3.0?
Yup, using ^1.3.1
What value are you getting from Dimensions.get('window').width and height?
@ptelad just tested, {height: 926, width: 428 }
and asked around about it when we upgraded to 1.3.1 that fixed the issue for us. (sorry, another team in my company ended up taking this one)
1.3.1 resolved for me as well.
@castrolem The original comment points this out as a problem but semantically, based on the library name, this would be correct behavior. The iPhone 12 is not an iPhone X. This gave me a lot of confusion just now while updating my orgs legacy app. Maybe you could consider adding a custom isIphone12() function?
@daaashleywch I agree, the name of the library hasn't aged well, but the description of the library is accurate
A library to help you design your react-native app for notched iPhones
And the 12 Pro Max is a notched iPhone, previous versions (before 1.3.1) worked with other 12 versions, just the Pro Max had the issue, no longer an issue after 1.3.1. 👍