1.2.0-1 • Published 3 years ago

@triplesense/capacitor-device-info v1.2.0-1

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
3 years ago

Capacitor Device Info Plugin

This plugin is a complement to the oficial Device Plugin.

Current version 1.2.0-0

See our detailed changelog for the latest features, improvements and bug fixes.

Features

Installation

npm

 npm i @triplesense/capacitor-device-info

Usage

First make sure to import the plugin, then get the Device info:

import { DeviceInfo, DeviceX } from '@triplesense/capacitor-device-info';

export const getDeviceInfo = async (): Promise<DeviceInfo> => {
  const { model, memRamTotal, diskTotal, identifier } = await DeviceX.getInfo();

  return {
    model,
    memRamTotal,
    diskTotal,
    identifier,
  };
};

API

getInfo()

getInfo() => Promise<DeviceInfo>

Get device info.

platform: android, ios

Returns: Promise<DeviceInfo>


Interfaces

DeviceInfo

PropTypeDescription
diskTotalnumberTotal disk size.
memRamTotalnumberTotal ram memory size.
modelstringDevice specific model.
identifierstringDevice specific model (on ios). On android will return model.

Source of Information

All model identifiers are taken from the following website: https://www.theiphonewiki.com/wiki/Models or extracted from the simulator app bundled with Xcode.

Note:

This plugin uses DeviceKit Library to get ios device info.

Contributing

If you have the need for a specific feature that you want implemented or if you experienced a bug, please open an issue. If you extended the functionality of @triplesense/capacitor-device-info yourself and want others to use it too, please submit a pull request.

1.2.0-1

3 years ago

1.2.0-0

3 years ago

1.1.1

5 years ago

1.0.2

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago