From 071d823c3bff36f221bd9d8795f7a37589178f00 Mon Sep 17 00:00:00 2001 From: jstjnsn <48677407+jstjnsn@users.noreply.github.com> Date: Wed, 26 Feb 2020 11:07:33 +0100 Subject: [PATCH 1/5] Include current device name in getInfo return Pull request for https://github.com/ionic-team/capacitor/issues/2130 --- ios/Capacitor/Capacitor/Plugins/Device.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/ios/Capacitor/Capacitor/Plugins/Device.swift b/ios/Capacitor/Capacitor/Plugins/Device.swift index 8444939cc..c120a74e9 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, From 7d6d364e7fa1eec9876a2579f956983f2fa85ab2 Mon Sep 17 00:00:00 2001 From: jstjnsn <48677407+jstjnsn@users.noreply.github.com> Date: Thu, 27 Feb 2020 08:34:36 +0100 Subject: [PATCH 2/5] Add 'name' to type defenition for DeviceInfo --- core/src/core-plugin-definitions.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/core-plugin-definitions.ts b/core/src/core-plugin-definitions.ts index 6ae95be5e..1eb355dd6 100644 --- a/core/src/core-plugin-definitions.ts +++ b/core/src/core-plugin-definitions.ts @@ -408,6 +408,10 @@ export interface DevicePlugin extends Plugin { export type OperatingSystem = 'ios' | 'android' | 'windows' | 'mac' | 'unknown'; export interface DeviceInfo { + /** + * The name of the device. For example, "John's iPhone" + */ + name: string; /** * The device model. For example, "iPhone" */ From 64a66e6be02cc5b754502e26112a9dd481fd93ed Mon Sep 17 00:00:00 2001 From: jstjnsn <48677407+jstjnsn@users.noreply.github.com> Date: Fri, 28 Feb 2020 10:06:32 +0100 Subject: [PATCH 3/5] Make 'name' property optional Property is iOS only so it has to be optional. Co-Authored-By: jcesarmobile --- core/src/core-plugin-definitions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/core-plugin-definitions.ts b/core/src/core-plugin-definitions.ts index 1eb355dd6..4e5439957 100644 --- a/core/src/core-plugin-definitions.ts +++ b/core/src/core-plugin-definitions.ts @@ -411,7 +411,7 @@ export interface DeviceInfo { /** * The name of the device. For example, "John's iPhone" */ - name: string; + name?: string; /** * The device model. For example, "iPhone" */ From cb6c04c02c70f734ecd576efdeecf50b753fe216 Mon Sep 17 00:00:00 2001 From: jstjnsn <48677407+jstjnsn@users.noreply.github.com> Date: Fri, 28 Feb 2020 10:14:08 +0100 Subject: [PATCH 4/5] Add notice to optional iOS only property 'name' --- core/src/core-plugin-definitions.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/core-plugin-definitions.ts b/core/src/core-plugin-definitions.ts index 4e5439957..feea85916 100644 --- a/core/src/core-plugin-definitions.ts +++ b/core/src/core-plugin-definitions.ts @@ -409,6 +409,7 @@ export type OperatingSystem = 'ios' | 'android' | 'windows' | 'mac' | 'unknown' export interface DeviceInfo { /** + * Note: this property is iOS only, so it is optional. * The name of the device. For example, "John's iPhone" */ name?: string; From ef2323669b2bc9c08e648ebb111d3c4e7320f474 Mon Sep 17 00:00:00 2001 From: jcesarmobile Date: Mon, 9 Mar 2020 17:03:30 +0100 Subject: [PATCH 5/5] Update core/src/core-plugin-definitions.ts --- core/src/core-plugin-definitions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/core-plugin-definitions.ts b/core/src/core-plugin-definitions.ts index feea85916..5c7f2b0ee 100644 --- a/core/src/core-plugin-definitions.ts +++ b/core/src/core-plugin-definitions.ts @@ -409,7 +409,7 @@ export type OperatingSystem = 'ios' | 'android' | 'windows' | 'mac' | 'unknown' export interface DeviceInfo { /** - * Note: this property is iOS only, so it is optional. + * Note: this property is iOS only. * The name of the device. For example, "John's iPhone" */ name?: string;