From 4fb244dcb2bd2b88beb131e3d1394fff7d39a67c Mon Sep 17 00:00:00 2001 From: jstjnsn <48677407+jstjnsn@users.noreply.github.com> Date: Mon, 9 Mar 2020 17:50:36 +0100 Subject: [PATCH] feat(ios): add device name to Device.getInfo() (#2491) --- core/src/core-plugin-definitions.ts | 5 +++++ ios/Capacitor/Capacitor/Plugins/Device.swift | 1 + 2 files changed, 6 insertions(+) diff --git a/core/src/core-plugin-definitions.ts b/core/src/core-plugin-definitions.ts index e21522a78f..a5d635db91 100644 --- a/core/src/core-plugin-definitions.ts +++ b/core/src/core-plugin-definitions.ts @@ -415,6 +415,11 @@ export interface DevicePlugin extends Plugin { export type OperatingSystem = 'ios' | 'android' | 'windows' | 'mac' | 'unknown'; export interface DeviceInfo { + /** + * Note: this property is iOS only. + * The name of the device. For example, "John's iPhone" + */ + name?: string; /** * The device model. For example, "iPhone" */ diff --git a/ios/Capacitor/Capacitor/Plugins/Device.swift b/ios/Capacitor/Capacitor/Plugins/Device.swift index 8444939cc0..c120a74e99 100644 --- a/ios/Capacitor/Capacitor/Plugins/Device.swift +++ b/ios/Capacitor/Capacitor/Plugins/Device.swift @@ -20,6 +20,7 @@ public class CAPDevicePlugin: CAPPlugin { "memUsed": memUsed, "diskFree": diskFree, "diskTotal": diskTotal, + "name": UIDevice.current.name, "model": UIDevice.current.model, "operatingSystem": "ios", "osVersion": UIDevice.current.systemVersion,