Skip to content

Commit 4fb244d

Browse files
author
jstjnsn
authored
feat(ios): add device name to Device.getInfo() (#2491)
1 parent 7020f1f commit 4fb244d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

core/src/core-plugin-definitions.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,11 @@ export interface DevicePlugin extends Plugin {
415415
export type OperatingSystem = 'ios' | 'android' | 'windows' | 'mac' | 'unknown';
416416

417417
export interface DeviceInfo {
418+
/**
419+
* Note: this property is iOS only.
420+
* The name of the device. For example, "John's iPhone"
421+
*/
422+
name?: string;
418423
/**
419424
* The device model. For example, "iPhone"
420425
*/

ios/Capacitor/Capacitor/Plugins/Device.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class CAPDevicePlugin: CAPPlugin {
2020
"memUsed": memUsed,
2121
"diskFree": diskFree,
2222
"diskTotal": diskTotal,
23+
"name": UIDevice.current.name,
2324
"model": UIDevice.current.model,
2425
"operatingSystem": "ios",
2526
"osVersion": UIDevice.current.systemVersion,

0 commit comments

Comments
 (0)