-
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
deviceName not updating when user updates device name on device #1272
Comments
That's odd. Looks like we fetch it dynamically: react-native-device-info/ios/RNDeviceInfo/RNDeviceInfo.m Lines 146 to 157 in 0e1319c
How did it go when you reached in there and added some debugging print statements + watched the logs? Is the system API we use behaving correctly? Does it mention anything in the related documentation about caching behavior in the system? |
@mikehardy in the js/ts side, it is memo-ized. We can remove the memo to resolve this issue. |
Ah ha! @chrisdrackett if you post a PR removing the memoization there, can happily merge + release tangent: oh man, the semantic release bot is golden here @schie, thank you so much for that |
Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is sti ll here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solu tions and if you found one, please open a pull request! You have 7 days until this gets closed automatically |
removes memoization of device name because the device's name can be changed resolves #1272 Co-authored-by: @chrisdrackett
* fix(index): removing memoization of `getDeviceName` removes memoization of device name because the device's name can be changed resolves #1272 Co-authored-by: @chrisdrackett * test(__tests__s/getters): changing tests for `getDeviceName` moves function from `memoizedStringGetters` to `nonMemoizedStringGetters`
🎉 This issue has been resolved in version 8.4.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This issue is still persist for android devices. Please suggest a workaround. |
No workaround to suggest, please investigate using standard troubleshooting techniques / debugging tools and if there's a problem, we can merge and release a PR really quickly |
Behaviour for this is strange, this is working on some devices and not for others. |
previously needed bluetooth, not supposed to need it now |
Yes no bluetooth permission is required. This work's for the first time. |
@anujwits then this comment drives progress on your part:
|
## [8.4.3](react-native-device-info/react-native-device-info@v8.4.2...v8.4.3) (2021-10-26) ### Bug Fixes * **getDeviceName:** un-memoize device name so it updates ([#1332](react-native-device-info/react-native-device-info#1332)) ([67b7155](react-native-device-info/react-native-device-info@67b7155)), closes [#1272](react-native-device-info/react-native-device-info#1272)
Does not work on iOS with v10.4.0. No matter what name our devices getDeviceName() always returns |
Turns out this is an issue with iOS 16. For anyone who winds up here, please refer to the issue documented here: #1516 |
## [8.4.3](react-native-device-info/react-native-device-info@v8.4.2...v8.4.3) (2021-10-26) ### Bug Fixes * **getDeviceName:** un-memoize device name so it updates ([#1332](react-native-device-info/react-native-device-info#1332)) ([7026844](react-native-device-info/react-native-device-info@7026844)), closes [#1272](react-native-device-info/react-native-device-info#1272)
Summary
Current behavior
after changing the device name and then calling
DeviceInfo.getDeviceName()
I'm still getting the old value.iPhone
)iPhone new
DeviceInfo.getDeviceName()
iPhone
and notiPhone new
Expected behavior
DeviceInfo.getDeviceName()
should report the current device nameThe text was updated successfully, but these errors were encountered: