Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public void getInfo(PluginCall call) {
r.put("model", android.os.Build.MODEL);
r.put("operatingSystem", "android");
r.put("osVersion", android.os.Build.VERSION.RELEASE);
r.put("osBuild", android.os.Build.VERSION.INCREMENTAL);
r.put("androidSDKVersion", Build.VERSION.SDK_INT);
r.put("platform", implementation.getPlatform());
r.put("manufacturer", android.os.Build.MANUFACTURER);
Expand Down
11 changes: 11 additions & 0 deletions device/ios/Sources/DevicePlugin/Device.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,15 @@ import UIKit

return Int(combined.joined())
}

func getVersionInfo() -> (version: String, build: String) {
let string = ProcessInfo.processInfo.operatingSystemVersionString
let cleaned = string.replacingOccurrences(of: "Version ", with: "").replacingOccurrences(of: "Build ", with: "")
let components = cleaned.split(separator: "(")

let version = components.first?.trimmingCharacters(in: .whitespacesAndNewlines) ?? "Unknown"
let build = components.count > 1 ? components[1].replacingOccurrences(of: ")", with: "").trimmingCharacters(in: .whitespacesAndNewlines) : "Unknown"

return (version, build)
}
}
4 changes: 3 additions & 1 deletion device/ios/Sources/DevicePlugin/DevicePlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class DevicePlugin: CAPPlugin, CAPBridgedPlugin {
let realDiskFree = implementation.getRealFreeDiskSize() ?? 0
let diskTotal = implementation.getTotalDiskSize() ?? 0
let systemVersionNum = implementation.getSystemVersionInt() ?? 0
let systemVersionInfo = implementation.getVersionInfo()

call.resolve([
"memUsed": memUsed,
Expand All @@ -48,7 +49,8 @@ public class DevicePlugin: CAPPlugin, CAPBridgedPlugin {
"name": UIDevice.current.name,
"model": modelName,
"operatingSystem": "ios",
"osVersion": UIDevice.current.systemVersion,
"osVersion": systemVersionInfo.version,
"osBuild": systemVersionInfo.build,
"iOSVersion": systemVersionNum,
"platform": "ios",
"manufacturer": "Apple",
Expand Down