Skip to content

Commit

Permalink
fix: rename Bundle var to have same name as Android
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Aug 18, 2022
1 parent 817c424 commit b68eee7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions ios/Plugin/CapacitorUpdater.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ extension OperatingSystemVersion {
}
}
extension Bundle {
var releaseVersionNumber: String? {
var versionName: String? {
return infoDictionary?["CFBundleShortVersionString"] as? String
}
var buildVersionNumber: String? {
var versionCode: String? {
return infoDictionary?["CFBundleVersion"] as? String
}
}
Expand Down Expand Up @@ -63,8 +63,8 @@ extension CustomError: LocalizedError {

@objc public class CapacitorUpdater: NSObject {

private var versionBuild = Bundle.main.releaseVersionNumber ?? ""
private var versionCode = Bundle.main.buildVersionNumber ?? ""
private var versionBuild = Bundle.main.versionName ?? ""
private var versionCode = Bundle.main.versionCode ?? ""
private var versionOs = ProcessInfo().operatingSystemVersion.getFullVersion()
private var lastPathHot = ""
private var lastPathPersist = ""
Expand Down
4 changes: 2 additions & 2 deletions ios/Plugin/CapacitorUpdaterPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin {

override public func load() {
do {
currentVersionNative = try Version(Bundle.main.buildVersionNumber ?? "0.0.0")
currentVersionNative = try Version(Bundle.main.versionName ?? "0.0.0")
} catch {
print("✨ Capacitor-updater: Cannot get version native \(currentVersionNative)")
}
Expand Down Expand Up @@ -49,7 +49,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
_ = implementation.delete(version: version, versionName: "")
}
}
UserDefaults.standard.set( Bundle.main.buildVersionNumber, forKey: "LatestVersionNative")
UserDefaults.standard.set( Bundle.main.versionName, forKey: "LatestVersionNative")
}
if (!autoUpdate || autoUpdateUrl == "") { return }
let nc = NotificationCenter.default
Expand Down

0 comments on commit b68eee7

Please sign in to comment.