-2

I have a grid list, where in it gets filled with User device details as soon as the user is logged in. so can anyone help me how do i fetch the device name from the browser and also i need to fetch the location of the system.

This is the Demo of my code.

Ts:

 var isDeviceType = (/iPad/i).test(navigator.userAgent) ?
    "iOS" : (/iPhone/i).test(navigator.userAgent) ?
    "iOS" : (/Android/i).test(navigator.userAgent) ?
    "Android" : (/BlackBerry/i).test(navigator.userAgent) ?
    "BlackBerry" : "Browser";
  console.log(isDeviceType)
  this.isDeviceType = isDeviceType;

From this set of information i am able to get on which i am using my device like Browser but i need to fetch the name of device and i am using navigator.userAgent to detect browser

Bhrungarajni
  • 2,415
  • 11
  • 44
  • 88

1 Answers1

0

From Javascript, you can only get user agent, not the device details. If you use a framework like phonegap it has API to fetch device details.

Ref: Getting (mobile) device name from javascript

shan kulkarni
  • 849
  • 7
  • 18