LoginSignup
17
18

More than 5 years have passed since last update.

Cordovaで端末情報を取得する

Last updated at Posted at 2014-12-16

org.apache.cordova.device を使うことで、UUIDなどの端末情報を取得することができます。

インストール

$ cordova plugin add org.apache.cordova.device

devicereadyイベント後に以下のように取得できます。

document.addEventListener('deviceready', function () {
    console.log('UUID: ' + device.uuid);
    console.log('model: ' + device.model);
    console.log('platform: ' + device.platform);
    console.log('version: ' + device.version);
}, false);

出力例

iOS

UUID: E5BA1AC9-6F7D-4815-AECB-3DF670281F81
model: iPhone5,2
platform: iOS
version: 8.1.1

Android

UUID: 7005121694c81ad5
model: FJL22
platform: Android
version: 4.2.2
17
18
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
18