-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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(hasNotch): Missing device name for iPhone 13 #1309
Conversation
Adds missing device name by code for iPhone 13 lineup. Relates to react-native-device-info#1307
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ios/RNDeviceInfo/RNDeviceInfo.m
Outdated
@"iPhone14,1": @"iPhone 13 mini", | ||
@"iPhone14,2": @"iPhone 13", | ||
@"iPhone14,3": @"iPhone 13 Pro", | ||
@"iPhone14,4": @"iPhone 13 Pro Max", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rolfb
for iPhone 13 the above combination is not working , whereas for other devices of 13 series its working as expected .
I tried with following combinations and looks me fine , i m not sure what is the number game of 1,2,3,4 vs 5,2,3,4.
@"iPhone14,5": @"iPhone 13 mini",
@"iPhone14,2": @"iPhone 13",
@"iPhone14,3": @"iPhone 13 Pro",
@"iPhone14,4": @"iPhone 13 Pro Max",
Sorry i am not IOS expert , just done some experiment with this numbers , so cant say anything about this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hiteshSavkare Great feedback, how exactly are you testing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rolfb Thanks,
react-native-device-info into is integrated in my project, so changed the file RNDeviceInfo.m with above code and building the project with xcode 13 and testing on simulators of 13 series
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hiteshSavkare updated the file now, going to try to verify with the most recent xcode beta as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good @rolfb, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hiteshSavkare Updated the list to match the device traits list in Xcode
sqlite> select ProductType,ProductDescription from Devices where ProductDescription LIKE 'iPhone 13%';
ProductType|ProductDescription
iPhone14,2|iPhone 13 Pro
iPhone14,3|iPhone 13 Pro Max
iPhone14,4|iPhone 13 mini
iPhone14,5|iPhone 13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great @rolfb , Hope you tested with simulators or Do i need to test again ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hiteshSavkare didn't check as I expect Xcode's own lookup tables to be correct. Feel free to verify as the list from Xcode isn't exactly matching the one you provided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rolfb looks fine 👍
@schie @mikehardy please hold back on merging this for a little while, need to verify codes with Xcode RC |
Updated device code to name mapping to match the information in the sqlite3 device traits database provided with Xcode RC.
Ok, I think we're good. Matching the exact values provided by Xcode RC itself from
|
Thank you all so much! |
🎉 This PR is included in version 8.3.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
iPhone 13 series hasNotch() not working giving value as false |
@harisshk https://stackoverflow.com/help/how-to-ask / https://stackoverflow.com/help/minimal-reproducible-example - I suspect you have outdated versions. Run our example from this repo on an iphone13 device and if you can reproduce open a new issue |
@harisshk same for me, tested in the simulator |
@pckz what version are you on? Like @mikehardy said to @harisshk, me thinks you're on an outdate version. |
(i've forced the latest version) |
Tested what in the simulator? Your app? Our example? Testing our example app would be best, no telling what your app is doing, since you haven't provided any details of it |
My project runs:
About the simulator, is Phone 13 running iOS 15.2. My XCode version is 13.2.1 (13C100) I get false value doing this: header :
componentWillMount:
|
## [8.3.3](react-native-device-info/react-native-device-info@v8.3.2...v8.3.3) (2021-09-16) ### Bug Fixes * **hasNotch:** Missing device name for iPhone 13 ([#1309](react-native-device-info/react-native-device-info#1309)) ([8cd309c](react-native-device-info/react-native-device-info@8cd309c)), closes [#1307](react-native-device-info/react-native-device-info#1307)
## [8.3.3](react-native-device-info/react-native-device-info@v8.3.2...v8.3.3) (2021-09-16) ### Bug Fixes * **hasNotch:** Missing device name for iPhone 13 ([#1309](react-native-device-info/react-native-device-info#1309)) ([0bc979e](react-native-device-info/react-native-device-info@0bc979e)), closes [#1307](react-native-device-info/react-native-device-info#1307)
Description
Adds missing device name by code for iPhone 13 lineup. Relates to #1307
Compatibility