Dhruvil Shah
Dhruvil Shah

Reputation: 416

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.

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

Upvotes: 1

Views: 1433

Answers (2)

Dhruvil Shah
Dhruvil Shah

Reputation: 416

Right now I am using getDeviceName() to get the string which indicates the device model.

As example if I am using iPhone 11 then getDeviceName() is going to return 'iPhone 11'

Upvotes: 1

Sunny Parekh
Sunny Parekh

Reputation: 983

iOS warning: The list with device names is maintained by the community and could lag new devices. It is recommended to use getDeviceId() since it's more reliable and always up-to-date with new iOS devices. We do accept pull requests that add new iOS devices to the list with device names.

Kindly take a note of it!

Upvotes: 3

Related Questions