Skip to content

Instantly share code, notes, and snippets.

@nncl
Last active September 6, 2017 17:04
Show Gist options
  • Save nncl/3146556526c6b76822ae96dd97f2b097 to your computer and use it in GitHub Desktop.
Save nncl/3146556526c6b76822ae96dd97f2b097 to your computer and use it in GitHub Desktop.
Ionic Device Information

Ionic Device Information

You can get information about client's device running:

var deviceInformation = ionic.Platform.device();
console.log(JSON.stringify(deviceInformation));

The console.log(JSON.stringify(deviceInformation)) shows this:

iOS emulator:

{  
   "available":true,
   "platform":"iOS",
   "version":"9.3",
   "uuid":"EEC2F136-795A-49C0-BE0D-E308F9AF7E40",
   "cordova":"3.8.0",
   "model":"x86_64",
   "manufacturer":"Apple",
   "isVirtual":true,
   "serial":"unknown"
}

Android Device:

{  
   "available":true,
   "platform":"Android",
   "version":"4.4.4",
   "uuid":"80553200bbdbd68a",
   "cordova":"5.1.1",
   "model":"D2306",
   "manufacturer":"Sony",
   "isVirtual":false,
   "serial":"BY900E95M9"
}

More information about device you can find here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment