Skip to content

Commit

Permalink
feat(ios): add device name to Device.getInfo() (#2491)
Browse files Browse the repository at this point in the history
  • Loading branch information
jstjnsn authored Mar 9, 2020
1 parent 7020f1f commit 4fb244d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/src/core-plugin-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
*/
Expand Down
1 change: 1 addition & 0 deletions ios/Capacitor/Capacitor/Plugins/Device.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4fb244d

Please sign in to comment.