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

[Question]: iOS model number (data.ustname.machine) resulting "iPhone12,8" but the device is "iPhone SE" #2225

Closed
8 tasks done
shishir2sr opened this issue Oct 6, 2023 · 1 comment
Labels
question Further information is requested

Comments

@shishir2sr
Copy link

What is your question?

I am working on a project where I need to parse the device model. I have providing below code portion
else if (Platform.isIOS) { IosDeviceInfo iosInfo = await deviceInfo.iosInfo; deviceInfoModel = deviceInfoModel.copyWith( deviceModel: iosInfo.utsname.machine, );}

  here the api ustname.machine returns "iPhone 12,8" but the actual model no. is "iPhone SE". How to solve it?

Checklist before submitting a question

  • I searched issues in this repository and couldn't find such bug/problem
  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I am using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project
@shishir2sr shishir2sr added the question Further information is requested label Oct 6, 2023
@vbuberen
Copy link
Collaborator

vbuberen commented Oct 7, 2023

Plugin returns correct machine name, which is not the same as the model name you used to.
It is also explained in API docs: https://pub.dev/documentation/device_info_plus/latest/device_info_plus/IosUtsname/machine.html

At the moment there is no reliable way to get iPhone SE string as you want using device_info_plus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants