@capacitor/device 1.0.5 → 1.1.2

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/CHANGELOG.md CHANGED
@@ -3,6 +3,47 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.1.2](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/device@1.1.1...@capacitor/device@1.1.2) (2022-01-19)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * inline source code in esm map files ([#760](https://github.com/ionic-team/capacitor-plugins/issues/760)) ([a960489](https://github.com/ionic-team/capacitor-plugins/commit/a960489a19db0182b90d187a50deff9dfbe51038))
12
+
13
+
14
+
15
+
16
+
17
+ ## [1.1.1](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/device@1.1.0...@capacitor/device@1.1.1) (2021-12-08)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **device:** isVirtual is false on M1 simulators ([#726](https://github.com/ionic-team/capacitor-plugins/issues/726)) ([5377586](https://github.com/ionic-team/capacitor-plugins/commit/53775863df624531e8ffa4b18852b408e1bd2cbd))
23
+
24
+
25
+
26
+
27
+
28
+ # [1.1.0](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/device@1.0.6...@capacitor/device@1.1.0) (2021-11-17)
29
+
30
+
31
+ ### Features
32
+
33
+ * **device:** Add realDiskTotal and realDiskFree properties ([#694](https://github.com/ionic-team/capacitor-plugins/issues/694)) ([3f67643](https://github.com/ionic-team/capacitor-plugins/commit/3f67643edf4cfd90a84d4606c4c6349b72531b92))
34
+
35
+
36
+
37
+
38
+
39
+ ## [1.0.6](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/device@1.0.5...@capacitor/device@1.0.6) (2021-11-03)
40
+
41
+ **Note:** Version bump only for package @capacitor/device
42
+
43
+
44
+
45
+
46
+
6
47
  ## [1.0.5](https://github.com/ionic-team/capacitor-plugins/compare/@capacitor/device@1.0.4...@capacitor/device@1.0.5) (2021-10-14)
7
48
 
8
49
 
package/README.md CHANGED
@@ -115,19 +115,21 @@ Get the device's current language locale code.
115
115
 
116
116
  #### DeviceInfo
117
117
 
118
- | Prop | Type | Description | Since |
119
- | --------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ----- |
120
- | **`name`** | <code>string</code> | The name of the device. For example, "John's iPhone". This is only supported on iOS and Android 7.1 or above. | 1.0.0 |
121
- | **`model`** | <code>string</code> | The device model. For example, "iPhone". | 1.0.0 |
122
- | **`platform`** | <code>'ios' \| 'android' \| 'web'</code> | The device platform (lowercase). | 1.0.0 |
123
- | **`operatingSystem`** | <code><a href="#operatingsystem">OperatingSystem</a></code> | The operating system of the device. | 1.0.0 |
124
- | **`osVersion`** | <code>string</code> | The version of the device OS. | 1.0.0 |
125
- | **`manufacturer`** | <code>string</code> | The manufacturer of the device. | 1.0.0 |
126
- | **`isVirtual`** | <code>boolean</code> | Whether the app is running in a simulator/emulator. | 1.0.0 |
127
- | **`memUsed`** | <code>number</code> | Approximate memory used by the current app, in bytes. Divide by 1048576 to get the number of MBs used. | 1.0.0 |
128
- | **`diskFree`** | <code>number</code> | How much free disk space is available on the the normal data storage. path for the os, in bytes | 1.0.0 |
129
- | **`diskTotal`** | <code>number</code> | The total size of the normal data storage path for the OS, in bytes. | 1.0.0 |
130
- | **`webViewVersion`** | <code>string</code> | The web view browser version | 1.0.0 |
118
+ | Prop | Type | Description | Since |
119
+ | --------------------- | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
120
+ | **`name`** | <code>string</code> | The name of the device. For example, "John's iPhone". This is only supported on iOS and Android 7.1 or above. | 1.0.0 |
121
+ | **`model`** | <code>string</code> | The device model. For example, "iPhone". | 1.0.0 |
122
+ | **`platform`** | <code>'ios' \| 'android' \| 'web'</code> | The device platform (lowercase). | 1.0.0 |
123
+ | **`operatingSystem`** | <code><a href="#operatingsystem">OperatingSystem</a></code> | The operating system of the device. | 1.0.0 |
124
+ | **`osVersion`** | <code>string</code> | The version of the device OS. | 1.0.0 |
125
+ | **`manufacturer`** | <code>string</code> | The manufacturer of the device. | 1.0.0 |
126
+ | **`isVirtual`** | <code>boolean</code> | Whether the app is running in a simulator/emulator. | 1.0.0 |
127
+ | **`memUsed`** | <code>number</code> | Approximate memory used by the current app, in bytes. Divide by 1048576 to get the number of MBs used. | 1.0.0 |
128
+ | **`diskFree`** | <code>number</code> | How much free disk space is available on the the normal data storage path for the os, in bytes. On Android it returns the free disk space on the "system" partition holding the core Android OS. On iOS this value is not accurate. | 1.0.0 |
129
+ | **`diskTotal`** | <code>number</code> | The total size of the normal data storage path for the OS, in bytes. On Android it returns the disk space on the "system" partition holding the core Android OS. | 1.0.0 |
130
+ | **`realDiskFree`** | <code>number</code> | How much free disk space is available on the the normal data storage, in bytes. | 1.1.0 |
131
+ | **`realDiskTotal`** | <code>number</code> | The total size of the normal data storage path, in bytes. | 1.1.0 |
132
+ | **`webViewVersion`** | <code>string</code> | The web view browser version | 1.0.0 |
131
133
 
132
134
 
133
135
  #### BatteryInfo
@@ -43,8 +43,8 @@ android {
43
43
 
44
44
  repositories {
45
45
  google()
46
- jcenter()
47
46
  mavenCentral()
47
+ jcenter()
48
48
  }
49
49
 
50
50
 
@@ -36,6 +36,16 @@ public class Device {
36
36
  return statFs.getBlockCountLong() * statFs.getBlockSizeLong();
37
37
  }
38
38
 
39
+ public long getRealDiskFree() {
40
+ StatFs statFs = new StatFs(Environment.getDataDirectory().getAbsolutePath());
41
+ return statFs.getAvailableBlocksLong() * statFs.getBlockSizeLong();
42
+ }
43
+
44
+ public long getRealDiskTotal() {
45
+ StatFs statFs = new StatFs(Environment.getDataDirectory().getAbsolutePath());
46
+ return statFs.getBlockCountLong() * statFs.getBlockSizeLong();
47
+ }
48
+
39
49
  public String getPlatform() {
40
50
  return "android";
41
51
  }
@@ -33,6 +33,8 @@ public class DevicePlugin extends Plugin {
33
33
  r.put("memUsed", implementation.getMemUsed());
34
34
  r.put("diskFree", implementation.getDiskFree());
35
35
  r.put("diskTotal", implementation.getDiskTotal());
36
+ r.put("realDiskFree", implementation.getRealDiskFree());
37
+ r.put("realDiskTotal", implementation.getRealDiskTotal());
36
38
  r.put("model", android.os.Build.MODEL);
37
39
  r.put("operatingSystem", "android");
38
40
  r.put("osVersion", android.os.Build.VERSION.RELEASE);
package/dist/docs.json CHANGED
@@ -206,24 +206,56 @@
206
206
  {
207
207
  "name": "diskFree",
208
208
  "tags": [
209
+ {
210
+ "text": "Use `realDiskFree`.",
211
+ "name": "deprecated"
212
+ },
209
213
  {
210
214
  "text": "1.0.0",
211
215
  "name": "since"
212
216
  }
213
217
  ],
214
- "docs": "How much free disk space is available on the the normal data storage.\npath for the os, in bytes",
218
+ "docs": "How much free disk space is available on the the normal data storage\npath for the os, in bytes.\n\nOn Android it returns the free disk space on the \"system\"\npartition holding the core Android OS.\nOn iOS this value is not accurate.",
215
219
  "complexTypes": [],
216
220
  "type": "number | undefined"
217
221
  },
218
222
  {
219
223
  "name": "diskTotal",
220
224
  "tags": [
225
+ {
226
+ "text": "Use `realDiskTotal`.",
227
+ "name": "deprecated"
228
+ },
221
229
  {
222
230
  "text": "1.0.0",
223
231
  "name": "since"
224
232
  }
225
233
  ],
226
- "docs": "The total size of the normal data storage path for the OS, in bytes.",
234
+ "docs": "The total size of the normal data storage path for the OS, in bytes.\n\nOn Android it returns the disk space on the \"system\"\npartition holding the core Android OS.",
235
+ "complexTypes": [],
236
+ "type": "number | undefined"
237
+ },
238
+ {
239
+ "name": "realDiskFree",
240
+ "tags": [
241
+ {
242
+ "text": "1.1.0",
243
+ "name": "since"
244
+ }
245
+ ],
246
+ "docs": "How much free disk space is available on the the normal data storage, in bytes.",
247
+ "complexTypes": [],
248
+ "type": "number | undefined"
249
+ },
250
+ {
251
+ "name": "realDiskTotal",
252
+ "tags": [
253
+ {
254
+ "text": "1.1.0",
255
+ "name": "since"
256
+ }
257
+ ],
258
+ "docs": "The total size of the normal data storage path, in bytes.",
227
259
  "complexTypes": [],
228
260
  "type": "number | undefined"
229
261
  },
@@ -63,18 +63,39 @@ export interface DeviceInfo {
63
63
  */
64
64
  memUsed?: number;
65
65
  /**
66
- * How much free disk space is available on the the normal data storage.
67
- * path for the os, in bytes
66
+ * How much free disk space is available on the the normal data storage
67
+ * path for the os, in bytes.
68
68
  *
69
+ * On Android it returns the free disk space on the "system"
70
+ * partition holding the core Android OS.
71
+ * On iOS this value is not accurate.
72
+ *
73
+ * @deprecated Use `realDiskFree`.
69
74
  * @since 1.0.0
70
75
  */
71
76
  diskFree?: number;
72
77
  /**
73
78
  * The total size of the normal data storage path for the OS, in bytes.
74
79
  *
80
+ * On Android it returns the disk space on the "system"
81
+ * partition holding the core Android OS.
82
+ *
83
+ * @deprecated Use `realDiskTotal`.
75
84
  * @since 1.0.0
76
85
  */
77
86
  diskTotal?: number;
87
+ /**
88
+ * How much free disk space is available on the the normal data storage, in bytes.
89
+ *
90
+ * @since 1.1.0
91
+ */
92
+ realDiskFree?: number;
93
+ /**
94
+ * The total size of the normal data storage path, in bytes.
95
+ *
96
+ * @since 1.1.0
97
+ */
98
+ realDiskTotal?: number;
78
99
  /**
79
100
  * The web view browser version
80
101
  *
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export type OperatingSystem = 'ios' | 'android' | 'windows' | 'mac' | 'unknown';\n\nexport interface DeviceId {\n /**\n * The UUID of the device as available to the app. This identifier may change\n * on modern mobile platforms that only allow per-app install UUIDs.\n *\n * On web, a random identifier is generated and stored on localStorage for subsequent calls.\n *\n * @since 1.0.0\n */\n uuid: string;\n}\n\nexport interface DeviceInfo {\n /**\n * The name of the device. For example, \"John's iPhone\".\n *\n * This is only supported on iOS and Android 7.1 or above.\n *\n * @since 1.0.0\n */\n name?: string;\n\n /**\n * The device model. For example, \"iPhone\".\n *\n * @since 1.0.0\n */\n model: string;\n\n /**\n * The device platform (lowercase).\n *\n * @since 1.0.0\n */\n platform: 'ios' | 'android' | 'web';\n\n /**\n * The operating system of the device.\n *\n * @since 1.0.0\n */\n operatingSystem: OperatingSystem;\n\n /**\n * The version of the device OS.\n *\n * @since 1.0.0\n */\n osVersion: string;\n\n /**\n * The manufacturer of the device.\n *\n * @since 1.0.0\n */\n manufacturer: string;\n\n /**\n * Whether the app is running in a simulator/emulator.\n *\n * @since 1.0.0\n */\n isVirtual: boolean;\n\n /**\n * Approximate memory used by the current app, in bytes. Divide by\n * 1048576 to get the number of MBs used.\n *\n * @since 1.0.0\n */\n memUsed?: number;\n\n /**\n * How much free disk space is available on the the normal data storage\n * path for the os, in bytes.\n *\n * On Android it returns the free disk space on the \"system\"\n * partition holding the core Android OS.\n * On iOS this value is not accurate.\n *\n * @deprecated Use `realDiskFree`.\n * @since 1.0.0\n */\n diskFree?: number;\n\n /**\n * The total size of the normal data storage path for the OS, in bytes.\n *\n * On Android it returns the disk space on the \"system\"\n * partition holding the core Android OS.\n *\n * @deprecated Use `realDiskTotal`.\n * @since 1.0.0\n */\n diskTotal?: number;\n\n /**\n * How much free disk space is available on the the normal data storage, in bytes.\n *\n * @since 1.1.0\n */\n realDiskFree?: number;\n\n /**\n * The total size of the normal data storage path, in bytes.\n *\n * @since 1.1.0\n */\n realDiskTotal?: number;\n\n /**\n * The web view browser version\n *\n * @since 1.0.0\n */\n webViewVersion: string;\n}\n\nexport interface BatteryInfo {\n /**\n * A percentage (0 to 1) indicating how much the battery is charged.\n *\n * @since 1.0.0\n */\n batteryLevel?: number;\n\n /**\n * Whether the device is charging.\n *\n * @since 1.0.0\n */\n isCharging?: boolean;\n}\n\nexport interface GetLanguageCodeResult {\n /**\n * Two character language code.\n *\n * @since 1.0.0\n */\n value: string;\n}\n\nexport interface DevicePlugin {\n /**\n * Return an unique identifier for the device.\n *\n * @since 1.0.0\n */\n getId(): Promise<DeviceId>;\n\n /**\n * Return information about the underlying device/os/platform.\n *\n * @since 1.0.0\n */\n getInfo(): Promise<DeviceInfo>;\n\n /**\n * Return information about the battery.\n *\n * @since 1.0.0\n */\n getBatteryInfo(): Promise<BatteryInfo>;\n\n /**\n * Get the device's current language locale code.\n *\n * @since 1.0.0\n */\n getLanguageCode(): Promise<GetLanguageCodeResult>;\n}\n\n/**\n * @deprecated Use `BatteryInfo`.\n * @since 1.0.0\n */\nexport type DeviceBatteryInfo = BatteryInfo;\n\n/**\n * @deprecated Use `GetLanguageCodeResult`.\n * @since 1.0.0\n */\nexport type DeviceLanguageCodeResult = GetLanguageCodeResult;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,MAAM,GAAG,cAAc,CAAe,QAAQ,EAAE;IACpD,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;CACxD,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,MAAM,GAAG,cAAc,CAAe,QAAQ,EAAE;IACpD,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;CACxD,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { DevicePlugin } from './definitions';\n\nconst Device = registerPlugin<DevicePlugin>('Device', {\n web: () => import('./web').then(m => new m.DeviceWeb()),\n});\n\nexport * from './definitions';\nexport { Device };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAuB5C,MAAM,OAAO,SAAU,SAAQ,SAAS;IACtC,KAAK,CAAC,KAAK;QACT,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;SACpB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE;YAC5D,MAAM,IAAI,CAAC,WAAW,CAAC,0CAA0C,CAAC,CAAC;SACpE;QAED,MAAM,EAAE,GAAG,SAAS,CAAC,SAAS,CAAC;QAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAElC,OAAO;YACL,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,QAAQ,EAAS,KAAK;YACtB,eAAe,EAAE,QAAQ,CAAC,eAAe;YACzC,SAAS,EAAE,QAAQ,CAAC,SAAS;YAC7B,YAAY,EAAE,SAAS,CAAC,MAAM;YAC9B,SAAS,EAAE,KAAK;YAChB,cAAc,EAAE,QAAQ,CAAC,cAAc;SACxC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE;YAC7D,MAAM,IAAI,CAAC,WAAW,CAAC,0CAA0C,CAAC,CAAC;SACpE;QACD,IAAI,OAAO,GAAQ,EAAE,CAAC;QAEtB,IAAI;YACF,OAAO,GAAG,MAAM,SAAS,CAAC,U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,CAAC,CAAC;YAC5D,QAAQ,CAAC,cAAc,GAAG,OAAO,CAAC;SACnC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM;QACJ,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;YACjC,IAAI,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YACjD,IAAI,GAAG,EAAE;gBACP,OAAO,GAAG,CAAC;aACZ;YAED,GAAG,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;YACnB,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;YAC5C,OAAO,GAAG,CAAC;SACZ;QACD,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;IAED,KAAK;QACH,OAAO,sCAAsC,CAAC,OAAO,CACnD,OAAO,EACP,UAAU,CAAC;YACT,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAChC,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;YACtC,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACxB,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n BatteryInfo,\n DeviceId,\n DeviceInfo,\n DevicePlugin,\n GetLanguageCodeResult,\n} from './definitions';\n\ndeclare global {\n interface Navigator {\n getBattery: any;\n oscpu: any;\n }\n\n interface Window {\n InstallTrigger?: any;\n ApplePaySession?: any;\n chrome?: any;\n }\n}\n\nexport class DeviceWeb extends WebPlugin implements DevicePlugin {\n async getId(): Promise<DeviceId> {\n return {\n uuid: this.getUid(),\n };\n }\n\n async getInfo(): Promise<DeviceInfo> {\n if (typeof navigator === 'undefined' || !navigator.userAgent) {\n throw this.unavailable('Device API not available in this browser');\n }\n\n const ua = navigator.userAgent;\n const uaFields = this.parseUa(ua);\n\n return {\n model: uaFields.model,\n platform: <const>'web',\n operatingSystem: uaFields.operatingSystem,\n osVersion: uaFields.osVersion,\n manufacturer: navigator.vendor,\n isVirtual: false,\n webViewVersion: uaFields.browserVersion,\n };\n }\n\n async getBatteryInfo(): Promise<BatteryInfo> {\n if (typeof navigator === 'undefined' || !navigator.getBattery) {\n throw this.unavailable('Device API not available in this browser');\n }\n let battery: any = {};\n\n try {\n battery = await navigator.getBattery();\n } catch (e) {\n // Let it fail, we don't care\n }\n\n return {\n batteryLevel: battery.level,\n isCharging: battery.charging,\n };\n }\n\n async getLanguageCode(): Promise<GetLanguageCodeResult> {\n return {\n value: navigator.language,\n };\n }\n\n parseUa(ua: string): any {\n const uaFields: any = {};\n const start = ua.indexOf('(') + 1;\n let end = ua.indexOf(') AppleWebKit');\n if (ua.indexOf(') Gecko') !== -1) {\n end = ua.indexOf(') Gecko');\n }\n const fields = ua.substring(start, end);\n if (ua.indexOf('Android') !== -1) {\n const tmpFields = fields.replace('; wv', '').split('; ').pop();\n if (tmpFields) {\n uaFields.model = tmpFields.split(' Build')[0];\n }\n uaFields.osVersion = fields.split('; ')[1];\n } else {\n uaFields.model = fields.split('; ')[0];\n if (typeof navigator !== 'undefined' && navigator.oscpu) {\n uaFields.osVersion = navigator.oscpu;\n } else {\n if (ua.indexOf('Windows') !== -1) {\n uaFields.osVersion = fields;\n } else {\n const tmpFields = fields.split('; ').pop();\n if (tmpFields) {\n const lastParts = tmpFields\n .replace(' like Mac OS X', '')\n .split(' ');\n uaFields.osVersion = lastParts[lastParts.length - 1].replace(\n /_/g,\n '.',\n );\n }\n }\n }\n }\n\n if (/android/i.test(ua)) {\n uaFields.operatingSystem = 'android';\n } else if (/iPad|iPhone|iPod/.test(ua) && !window.MSStream) {\n uaFields.operatingSystem = 'ios';\n } else if (/Win/.test(ua)) {\n uaFields.operatingSystem = 'windows';\n } else if (/Mac/i.test(ua)) {\n uaFields.operatingSystem = 'mac';\n } else {\n uaFields.operatingSystem = 'unknown';\n }\n\n // Check for browsers based on non-standard javascript apis, only not user agent\n const isFirefox = !!window.InstallTrigger;\n const isSafari = !!window.ApplePaySession;\n const isChrome = !!window.chrome;\n const isEdge = /Edg/.test(ua);\n const isFirefoxIOS = /FxiOS/.test(ua);\n const isChromeIOS = /CriOS/.test(ua);\n const isEdgeIOS = /EdgiOS/.test(ua);\n\n // FF and Edge User Agents both end with \"/MAJOR.MINOR\"\n if (\n isSafari ||\n (isChrome && !isEdge) ||\n isFirefoxIOS ||\n isChromeIOS ||\n isEdgeIOS\n ) {\n // Safari version comes as \"... Version/MAJOR.MINOR ...\"\n // Chrome version comes as \"... Chrome/MAJOR.MINOR ...\"\n // FirefoxIOS version comes as \"... FxiOS/MAJOR.MINOR ...\"\n // ChromeIOS version comes as \"... CriOS/MAJOR.MINOR ...\"\n let searchWord: string;\n if (isFirefoxIOS) {\n searchWord = 'FxiOS';\n } else if (isChromeIOS) {\n searchWord = 'CriOS';\n } else if (isEdgeIOS) {\n searchWord = 'EdgiOS';\n } else if (isSafari) {\n searchWord = 'Version';\n } else {\n searchWord = 'Chrome';\n }\n\n const words = ua.split(' ');\n for (const word of words) {\n if (word.includes(searchWord)) {\n const version = word.split('/')[1];\n uaFields.browserVersion = version;\n }\n }\n } else if (isFirefox || isEdge) {\n const reverseUA = ua.split('').reverse().join('');\n const reverseVersion = reverseUA.split('/')[0];\n const version = reverseVersion.split('').reverse().join('');\n uaFields.browserVersion = version;\n }\n\n return uaFields;\n }\n\n getUid(): string {\n if (typeof window !== 'undefined') {\n let uid = window.localStorage.getItem('_capuid');\n if (uid) {\n return uid;\n }\n\n uid = this.uuid4();\n window.localStorage.setItem('_capuid', uid);\n return uid;\n }\n return this.uuid4();\n }\n\n uuid4(): string {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(\n /[xy]/g,\n function (c) {\n const r = (Math.random() * 16) | 0,\n v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n },\n );\n }\n}\n"]}
@@ -33,6 +33,22 @@ import Foundation
33
33
  return nil
34
34
  }
35
35
 
36
+ /**
37
+ * Get real free disk space
38
+ */
39
+ public func getRealFreeDiskSize() -> Int64? {
40
+ do {
41
+ let values = try URL(fileURLWithPath: NSHomeDirectory() as String).resourceValues(forKeys: [URLResourceKey.volumeAvailableCapacityForImportantUsageKey])
42
+ if let available = values.volumeAvailableCapacityForImportantUsage {
43
+ return available
44
+ } else {
45
+ return nil
46
+ }
47
+ } catch {
48
+ return nil
49
+ }
50
+ }
51
+
36
52
  /**
37
53
  * Get total disk size
38
54
  */
@@ -16,18 +16,21 @@ public class DevicePlugin: CAPPlugin {
16
16
  }
17
17
  @objc func getInfo(_ call: CAPPluginCall) {
18
18
  var isSimulator = false
19
- #if arch(i386) || arch(x86_64)
19
+ #if targetEnvironment(simulator)
20
20
  isSimulator = true
21
21
  #endif
22
22
 
23
23
  let memUsed = implementation.getMemoryUsage()
24
24
  let diskFree = implementation.getFreeDiskSize() ?? 0
25
+ let realDiskFree = implementation.getRealFreeDiskSize() ?? 0
25
26
  let diskTotal = implementation.getTotalDiskSize() ?? 0
26
27
 
27
28
  call.resolve([
28
29
  "memUsed": memUsed,
29
30
  "diskFree": diskFree,
30
31
  "diskTotal": diskTotal,
32
+ "realDiskFree": realDiskFree,
33
+ "realDiskTotal": diskTotal,
31
34
  "name": UIDevice.current.name,
32
35
  "model": UIDevice.current.model,
33
36
  "operatingSystem": "ios",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/device",
3
- "version": "1.0.5",
3
+ "version": "1.1.2",
4
4
  "description": "The Device API exposes internal information about the device, such as the model and operating system version, along with user information such as unique ids.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -34,7 +34,7 @@
34
34
  "verify:android": "cd android && ./gradlew clean build test && cd ..",
35
35
  "verify:web": "npm run build && npm test",
36
36
  "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
37
- "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- autocorrect --format",
37
+ "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
38
38
  "eslint": "eslint . --ext ts",
39
39
  "prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
40
40
  "swiftlint": "node-swiftlint",
@@ -83,5 +83,5 @@
83
83
  "publishConfig": {
84
84
  "access": "public"
85
85
  },
86
- "gitHead": "eadbffd4bf9f0859bd301a639ab4e0c3337ea8db"
86
+ "gitHead": "f18ee6482e1ec8e5fb0290d51f598397133af990"
87
87
  }