[Question]: iOS device_info_plus "Nodename" always returns "localhost" on iOS 17+
What is your question?
Platform iOS 17.0.3
Plugin device_info_plus
Plugin Version 9.1.0
Flutter SDK 3.13.6
Steps to reproduce
- Connect real iOS device (iPad) running iOS 17.0.3 to IDE and run our application.
- Attempt to obtain the device name (nodename) using the following code:
var data = await _deviceInfoPlugin.iosInfo;
final deviceName = data.utsname.nodename;
Before updating to iOS 17,data.utsname.nodename would always return the name of the device, however data.utsname.nodename now always returns localhost since updating to iOS 17.
Is anyone able to advise on whether or not data.utsname.nodename will now always return localhost on iOS versions >= iOS 17? Is it likely that any future plugin updates will fix this (if possible?)
Checklist before submitting a question
- [X] I searched issues in this repository and couldn't find such bug/problem
- [X] I Google'd a solution and I couldn't find it
- [X] I searched on StackOverflow for a solution and I couldn't find it
- [X] I read the README.md file of the plugin
- [X] I am using the latest version of the plugin
- [X] All dependencies are up to date with
flutter pub upgrade - [X] I did a
flutter clean - [X] I tried running the example project
I got the same issue
Same here, has anyone found a solution?
Same here. I figured it out when iOS app was published on TestFlight.
On my side, I've used
utsname.machine?.split(",")[0]
It worked.
utsname.machine gives iPhone 15,3 for 15.
iPhone 10,6 for iPhone X.
Better use this.
Thanks.
Same here. I figured it out when iOS app was published on TestFlight.
On my side, I've used
utsname.machine?.split(",")[0]It worked.
utsname.machinegives iPhone 15,3 for 15. iPhone 10,6 for iPhone X. Better use this.Thanks.
Thanks for the workaround, but this would not work for some devices. iPhone 12 Pro is being reported as iPhone 13,3 😆 thanks to Apple's magical naming convention.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days