How to get device name in ionic?

How we get device name in ionic 3?
for example iPhone 5,iPhone 7,Samsung Galaxy S3

Hey @cooldp007,

did you took a look on the API dcos? This plugin should actually solve your problem:

The device.model returns the name of the device's model or product. The value is set by the device manufacturer and may be different across versions of the same product.

Supported Platforms
Quick Example
// Android:    Nexus One       returns "Passion" (Nexus One code name)
//             Motorola Droid  returns "voles"
// BlackBerry: Torch 9800      returns "9800"
// Browser:    Google Chrome   returns "Chrome"
//             Safari          returns "Safari"
// iOS:     for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. See
// OSX:                        returns "x86_64"
var model = device.model;

Good luck,


I would have also a look on this one:

I did not find a CSV for this data, but at least you could assign a code to a real device name. Just save yourself time and code a simple API.

1 Like

I found some JSON:

1 Like

Hello, @odorakel

Thanks for giving me various solution for my query

Now i take device width and height by this.platform.width() and this.platform.height() and from width and height i will judge
for e.g. if width is 320 and height is 568 then i know that it is iPhone 5

@cooldp007: This solutions works prob perfectly with IOS devices. But Android seems to be a little bit more complex.

Keep calm and code on…