@capgo/capacitor-device-info 8.0.1 → 8.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,15 +7,58 @@
7
7
  <h2><a href="https://capgo.app/consulting/?ref=plugin_device_info">Missing a feature? We build Capacitor plugins</a></h2>
8
8
  </div>
9
9
 
10
- Capacitor plugin for reading CPU, memory, GPU, storage, thermal, low-power-mode, and onboard sensor data from iOS, Android, and Web.
10
+ Production-ready Capacitor plugin for device diagnostics, support screens, QA tools, and in-app performance dashboards. Read CPU, memory, GPU, storage, thermal, low-power-mode, and onboard sensor data from iOS, Android, and Web with one snapshot call or a live interval stream.
11
+
12
+ <p align="center">
13
+ <img src="https://raw.githubusercontent.com/Cap-go/capacitor-device-info/main/.github/assets/device-info-example.png" alt="@capgo/capacitor-device-info example app streaming CPU, memory, storage, GPU, and onboard sensor metrics" width="900" />
14
+ </p>
11
15
 
12
16
  ## Features
13
17
 
14
- - Read an instant device snapshot with CPU, memory, GPU, storage, and onboard sensor fields.
15
- - Stream snapshots on an interval with `deviceInfoUpdate` listeners for charts and dashboards.
16
- - Stop streams by duration or sample count.
17
- - Reports available onboard sensors and common readings such as Android battery temperature, ambient temperature, humidity, pressure, light, and proximity when hardware exposes them.
18
- - Uses native platform APIs: Metal, Mach, and CoreMotion availability on iOS; ActivityManager, StatFs, `/proc`, OpenGL ES, SensorManager, and thermal zones on Android.
18
+ - One API for instant snapshots and live monitoring streams.
19
+ - No runtime permissions for the metrics currently exposed.
20
+ - Built for support/debug dashboards: identify low memory, storage pressure, low power mode, thermal state, GPU renderer, and hardware sensor availability.
21
+ - Listener-first streaming for charts: `deviceInfoUpdate` emits CPU, memory, storage, GPU, thermal, and sensor snapshots on a configurable interval.
22
+ - Auto-stop streams by `durationMs` or `sampleCount`.
23
+ - Onboard sensor catalog with common readings when hardware exposes them: battery temperature, ambient temperature, relative humidity, pressure, light, and proximity.
24
+ - Native implementations: Metal, Mach, and CoreMotion availability on iOS; ActivityManager, StatFs, `/proc`, OpenGL ES, SensorManager, and thermal zones on Android.
25
+
26
+ ## What You Can Read
27
+
28
+ | Area | Data |
29
+ | ---- | ---- |
30
+ | CPU | Core count, active cores, architecture, model, usage percent, max frequency, Android best-effort CPU temperature |
31
+ | Memory | Total/free/used bytes, used percent, app heap usage/limit, low-memory flag, pressure state |
32
+ | Storage | Total/free/used bytes and used percent for the app data volume |
33
+ | GPU | API, vendor, renderer, version, max texture size, Android best-effort GPU temperature |
34
+ | Power | Low power mode / battery saver state |
35
+ | Thermal | Platform thermal state: `nominal`, `fair`, `serious`, `critical`, or `unknown` |
36
+ | Sensors | Full onboard sensor list plus sampled readings for supported environmental/proximity sensors |
37
+ | Stream metadata | Sequence number, stream start timestamp, elapsed milliseconds |
38
+
39
+ ## Sensor Coverage
40
+
41
+ | Reading | iOS | Android | Web |
42
+ | ------- | --- | ------- | --- |
43
+ | Sensor availability list | CoreMotion sensor availability | `SensorManager` full sensor list | Empty fallback |
44
+ | CPU/GPU temperature | Not exposed by public iOS APIs | Best-effort thermal-zone reads | Not exposed |
45
+ | Battery temperature | Not exposed by public iOS APIs | `ACTION_BATTERY_CHANGED` | Not exposed |
46
+ | Ambient temperature | Not exposed | Sampled when `TYPE_AMBIENT_TEMPERATURE` exists | Not exposed |
47
+ | Relative humidity | Not exposed | Sampled when `TYPE_RELATIVE_HUMIDITY` exists | Not exposed |
48
+ | Pressure | Barometer availability | Sampled when `TYPE_PRESSURE` exists | Not exposed |
49
+ | Light | Not exposed | Sampled when `TYPE_LIGHT` exists | Not exposed |
50
+ | Proximity | Not exposed | Sampled when `TYPE_PROXIMITY` exists | Not exposed |
51
+
52
+ Sensor data is onboard-only. This plugin does not call weather services or fetch outside temperature/humidity from the network.
53
+
54
+ ## Common Use Cases
55
+
56
+ - Add a diagnostics panel to support tickets.
57
+ - Stream device metrics into an in-app performance graph.
58
+ - Detect low-memory or low-storage conditions before heavy work.
59
+ - Show hardware/GPU details when debugging device-specific rendering bugs.
60
+ - Log thermal and low-power state around slow sessions.
61
+ - Discover available sensors before enabling sensor-heavy features.
19
62
 
20
63
  ## Compatibility
21
64
 
@@ -56,8 +99,6 @@ await handle.remove();
56
99
 
57
100
  CPU usage is calculated from deltas, so the first native sample may omit `cpu.usagePercent`. Periodic monitoring fills it after the second sample when the platform exposes CPU ticks.
58
101
 
59
- Sensor data is onboard-only. This plugin does not call weather services or fetch outside temperature/humidity from the network.
60
-
61
102
  ## Platform Notes
62
103
 
63
104
  - iOS requires no permissions for the metrics exposed here. GPU data comes from Metal, CPU and memory data comes from Mach APIs, and sensor availability comes from CoreMotion checks. iOS public APIs do not expose raw CPU/GPU temperature.
@@ -58,7 +58,7 @@ public class DeviceInfo {
58
58
  }
59
59
 
60
60
  public String getPluginVersion() {
61
- return "8.0.1";
61
+ return "8.0.3";
62
62
  }
63
63
 
64
64
  private JSObject getCpuInfo() {
@@ -26,7 +26,7 @@ import Metal
26
26
  }
27
27
 
28
28
  @objc public func getPluginVersion() -> String {
29
- return "8.0.1"
29
+ return "8.0.3"
30
30
  }
31
31
 
32
32
  private func cpuInfo() -> [String: Any] {
@@ -3,7 +3,7 @@ import Foundation
3
3
 
4
4
  @objc(DeviceInfoPlugin)
5
5
  public class DeviceInfoPlugin: CAPPlugin, CAPBridgedPlugin {
6
- private let pluginVersion = "8.0.1"
6
+ private let pluginVersion = "8.0.3"
7
7
  private let defaultIntervalMs = 1000
8
8
  private let minimumIntervalMs = 250
9
9
 
@@ -17,6 +17,6 @@ class DeviceInfoTests: XCTestCase {
17
17
  let implementation = DeviceInfo()
18
18
  let result = implementation.getPluginVersion()
19
19
 
20
- XCTAssertEqual("8.0.1", result)
20
+ XCTAssertEqual("8.0.3", result)
21
21
  }
22
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-device-info",
3
- "version": "8.0.1",
3
+ "version": "8.0.3",
4
4
  "description": "Capacitor plugin for reading CPU, memory, GPU, storage, and onboard sensor metrics.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",