Socket
Socket
Sign inDemoInstall

@awesome-cordova-library/device

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @awesome-cordova-library/device

This plugin defines a global device object, which describes the device's hardware and software. Although the object is in the global scope, it is not available until after the deviceready event.


Version published
Weekly downloads
1
Maintainers
1
Install size
14.2 kB
Created
Weekly downloads
 

Readme

Source

id: plugin-device title: Device tags:

  • cordova
  • capacitor
  • ionic
  • javascript
  • typescript
  • plugin
  • mobile
  • device

Device

This plugin defines a global device object, which describes the device's hardware and software. Although the object is in the global scope, it is not available until after the deviceready event.

Online documentation

Cordova documentation

Installation

Cordova

cordova plugin add cordova-plugin-device
npm install @awesome-cordova-library/device

Capacitor / Ionic

npm install cordova-plugin-device
npm install @awesome-cordova-library/device
npx cap sync

Vanilla

Declaration

class Device {
  static getModel(): string;
  static getPlatform(): string;
  static getVersion(): string;
  static getUuid(): string | null;
  static getManufacturer(): string | null;
  static getIsVirtual(): boolean;
}

Usages

import Device from "@awesome-cordova-library/device";

Device.getModel();
Device.getPlatform();
Device.getVersion();
Device.getUuid();
Device.getManufacturer();
Device.getIsVirtual();

React

Declartion

const useDevice: () => {
  getModel: () => string;
  getPlatform: () => string;
  getUuid: () => string | null;
  getVersion: () => string | null;
  getManufacturer: () => string | null;
};

Usages

import { useEffect } from "react";
import useDevice from "@awesome-cordova-library/device/lib/react";

function App() {
  const { getModel, getPlatform, getUuid, getVersion, getManufacturer } =
    useDevice();

  useEffect(() => {
    getModel();
    getPlatform();
    getUuid();
    getVersion();
    getManufacturer();
  }, []);
}

Keywords

FAQs

Last updated on 12 Sep 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc