device.platform

장치의 운영 체제 이름을 얻을.

var string = device.platform;

지원 되는 플랫폼

  • 안 드 로이드
  • 블랙베리 WebWorks (운영 체제 5.0와 더 높은)
  • iOS
  • Tizen
  • Windows Phone 7과 8
  • 윈도우 8

빠른 예제

// Depending on the device, a few examples are:
//   - "Android"
//   - "BlackBerry"
//   - "iOS"
//   - "WinCE"
//   - "Tizen"
var devicePlatform = device.platform;

전체 예제

<!DOCTYPE html>
<html>
  <head>
    <title>Device Properties Example</title>

    <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
    <script type="text/javascript" charset="utf-8">

    // Wait for device API libraries to load
    //
    document.addEventListener("deviceready", onDeviceReady, false);

    // device APIs are available
    //
    function onDeviceReady() {
        var element = document.getElementById('deviceProperties');
        element.innerHTML = 'Device Model: '    + device.model    + '<br />' +
                            'Device Cordova: '  + device.cordova  + '<br />' +
                            'Device Platform: ' + device.platform + '<br />' +
                            'Device UUID: '     + device.uuid     + '<br />' +
                            'Device Version: '  + device.version  + '<br />';
    }

    </script>
  </head>
  <body>
    <p id="deviceProperties">Loading device properties...</p>
  </body>
</html>

블랙베리 단점

장치는 플랫폼 이름 대신 장치 플랫폼 버전 번호를 반환할 수 있습니다. 예를 들어 Storm2 9550과 같은 값을 반환2.13.0.95.

Windows Phone 7 단점

Windows Phone 7 장치 보고 플랫폼으로WinCE.

Windows Phone 8 단점

Windows Phone 8 장치 보고 플랫폼으로Win32NT.