Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

cordova-plugin-device-name

becvert2.5kMIT1.3.5TypeScript support: definitely-typed

Cordova Device Name Plugin

ecosystem:cordova, cordova-android, cordova-windows, cordova-ios, cordova, device, name

readme

Cordova Device Name Plugin

This plugin allows you to get the user-friendly name of the device.

On Android, a bluetooth adapter is required. Android emulator does not have bluetooth capabilities!

CHANGELOG

Installation

In your application project directory:

cordova plugin add cordova-plugin-device-name

Usage

var deviceName = cordova.plugins.deviceName;

console.log(deviceName.name) // e.g: Becvert's iPad

deviceName.get(function success(name) {
    console.log(name);
}, function failure(error) {
    console.log(error);
});

if you installed cordova-plugin-device you can use:

window.device.name

Credits

All the credits go to the official cordova-plugin-device plugin.

Licence

The MIT License

changelog

[1.3.5] - 2019-03-23

  • 'requireCordovaModule' isn't supported anymore on cordova 9

[1.3.4] - 2018-07-23

  • [Android] improving merge of bluetooth permissions (white spaces)

[1.3.3] - 2018-05-24

  • [Android] using Global system settings with API 24+.
  • [Android] fixing duplicate declarations of bluetooth permission

[1.3.2] - 2017-10-14

  • [Android] fixed the maxSdkVersion of permission android.permission.BLUETOOTH must be at least 18
  • [Android] returns null if device name not found instead of an alert dialog

[1.3.1] - 2017-10-13

  • [Android] reverted to using BLUETOOTH permission for devices with API 17 and below.
  • [Android] BluetoothAdapter required again.

[1.3.0] - 2017-09-07

  • [Android] removed BLUETOOTH permission using Global and Secure system settings instead.