Skip to content
Permalink
Browse files
docs: various README enhancments (#124)
* docs: various README enhancments

- Removes obsolete platforms
- Replaces outdated links
- Corrects style writing of OS X

* doc: remove deprecated windows phone 7 comment

Co-authored-by: Erisu <erisu@apache.org>
  • Loading branch information
timbru31 and erisu committed Apr 1, 2022
1 parent 5b3d2cb commit 1e582ab9465784d972bc049424ad05e3a6b6b37d
Showing 1 changed file with 26 additions and 35 deletions.
@@ -60,7 +60,7 @@ Get the version of Cordova running on the device.
- Browser
- iOS
- Windows
- OSX
- OS X

## device.model

@@ -74,25 +74,24 @@ different across versions of the same product.
- Browser
- iOS
- Windows
- OSX
- OS X

### Quick Example

```js
// 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 http://theiphonewiki.com/wiki/index.php?title=Models
// OSX: returns "x86_64"
// iOS: for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1. See https://www.theiphonewiki.com/wiki/Models
// OS X: returns "x86_64"
//
var model = device.model;
```

### Android Quirks

- Gets the [product name](http://developer.android.com/reference/android/os/Build.html#PRODUCT) instead of the [model name](http://developer.android.com/reference/android/os/Build.html#MODEL), which is often the production code name. For example, the Nexus One returns `Passion`, and Motorola Droid returns `voles`.
- Gets the [product name](https://developer.android.com/reference/android/os/Build.html#PRODUCT) instead of the [model name](https://developer.android.com/reference/android/os/Build.html#MODEL), which is often the production code name. For example, the Nexus One returns `Passion`, and Motorola Droid returns `voles`.

## device.platform

@@ -107,25 +106,24 @@ var string = device.platform;
- Browser
- iOS
- Windows
- OSX
- OS X

### Quick Example

```js
// Depending on the device, a few examples are:
// - "Android"
// - "BlackBerry 10"
// - "browser"
// - "iOS"
// - "WinCE"
// - "Tizen"
// - "Mac OS X"
//
var devicePlatform = device.platform;
```

## device.uuid

Get the device's Universally Unique Identifier ([UUID](http://en.wikipedia.org/wiki/Universally_Unique_Identifier)).
Get the device's Universally Unique Identifier ([UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)).

```js
var string = device.uuid;
@@ -140,22 +138,19 @@ The details of how a UUID is generated are determined by the device manufacturer
- Android
- iOS
- Windows
- OSX
- OS X

### Quick Example

```js
// Android: Returns a random 64-bit integer (as a string, again!)
//
// BlackBerry: Returns the PIN number of the device
// This is a nine-digit unique integer (as a string, though!)
//
// iPhone: (Paraphrased from the UIDevice Class documentation)
// iOS: (Paraphrased from the UIDevice Class documentation)
// Returns the [UIDevice identifierForVendor] UUID which is unique and the same for all apps installed by the same vendor. However the UUID can be different if the user deletes all apps from the vendor and then reinstalls it.
//
// Windows Phone 7 : Returns a hash of device+current user,
// if the user is not defined, a guid is generated and will persist until the app is uninstalled
// Tizen: returns the device IMEI (International Mobile Equipment Identity or IMEI is a number
// unique to every GSM and UMTS mobile phone.
//
var deviceID = device.uuid;
```

@@ -178,12 +173,12 @@ Read more here https://developer.android.com/reference/android/provider/Settings
### iOS Quirk

The `uuid` on iOS uses the identifierForVendor property. It is unique to the device across the same vendor, but will be different for different vendors and will change if all apps from the vendor are deleted and then reinstalled.
Refer [here](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/#//apple_ref/occ/instp/UIDevice/identifierForVendor) for details.
Refer [here](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor) for details.
The UUID will be the same if app is restored from a backup or iCloud as it is saved in preferences. Users using older versions of this plugin will still receive the same previous UUID generated by another means as it will be retrieved from preferences.

### OSX Quirk
### OS X Quirk

The `uuid` on OSX is generated automatically if it does not exist yet and is stored in the `standardUserDefaults` in the `CDVUUID` property.
The `uuid` on OS X is generated automatically if it does not exist yet and is stored in the `standardUserDefaults` in the `CDVUUID` property.

## device.version

@@ -193,11 +188,11 @@ Get the operating system version.

### Supported Platforms

- Android 2.1+
- Android
- Browser
- iOS
- Windows
- OSX
- OS X

### Quick Example

@@ -206,16 +201,13 @@ Get the operating system version.
// Eclair OS would return "2.1", "2.0.1", or "2.0"
// Version can also return update level "2.1-update1"
//
// BlackBerry: Torch 9800 using OS 6.0 would return "6.0.0.600"
//
// Browser: Returns version number for the browser
//
// iPhone: iOS 3.2 returns "3.2"
// iOS: iOS 3.2 returns "3.2"
//
// Windows Phone 7: returns current OS version number, ex. on Mango returns 7.10.7720
// Windows 8: return the current OS version, ex on Windows 8.1 returns 6.3.9600.16384
// Tizen: returns "TIZEN_20120425_2"
// OSX: El Capitan would return "10.11.2"
//
// OS X: El Capitan would return "10.11.2"
//
var deviceVersion = device.version;
```
@@ -236,8 +228,7 @@ Get the device's manufacturer.

```js
// Android: Motorola XT1032 would return "motorola"
// BlackBerry: returns "BlackBerry"
// iPhone: returns "Apple"
// iOS: returns "Apple"
//
var deviceManufacturer = device.manufacturer;
```
@@ -252,19 +243,19 @@ var isSim = device.isVirtual;

### Supported Platforms

- Android 2.1+
- Android
- Browser
- iOS
- Windows
- OSX
- OS X

### OSX and Browser Quirk
### OS X and Browser Quirk

The `isVirtual` property on OS X and Browser always returns false.

## device.serial

Get the device hardware serial number ([SERIAL](http://developer.android.com/reference/android/os/Build.html#SERIAL)).
Get the device hardware serial number ([SERIAL](https://developer.android.com/reference/android/os/Build.html#SERIAL)).

```js
var string = device.serial;
@@ -273,7 +264,7 @@ var string = device.serial;
### Supported Platforms

- Android
- OSX
- OS X

### Android Quirk

0 comments on commit 1e582ab

Please sign in to comment.