简体   繁体   English

device.getModel() 无法正常工作

[英]device.getModel() is not working properly

I am trying to get the modelname using DeviceInfo.getModel() the inbuilt method that is provided by the react-native-device-info but for each model instead of giving the model name it is returning iPhone.I am not able to understand why this is happening.我正在尝试使用 DeviceInfo.getModel() 获取模型名称,这是由 react-native-device-info 提供的内置方法,但是对于每个 model 而不是给出 model 名称,它返回 iPhone。我无法理解为什么这正在发生。

here is the code that I am using这是我正在使用的代码

console.log(DeviceInfo.getModel());

note that the version of react-native and react-native-device-info are respectively 0.53 and 0.12.1注意 react-native 和 react-native-device-info 的版本分别是 0.53 和 0.12.1

iOS warning: The list with device names is maintained by the community and could lag new devices. iOS 警告:设备名称列表由社区维护,可能滞后于新设备。 It is recommended to use getDeviceId() since it's more reliable and always up-to-date with new iOS devices.建议使用 getDeviceId(),因为它更可靠,并且始终与新的 iOS 设备保持同步。 We do accept pull requests that add new iOS devices to the list with device names.我们接受将新的 iOS 设备添加到带有设备名称的列表中的拉取请求。

Kindly take a note of it!请注意!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM