Skip to content

Commit

Permalink
Merge pull request #48 from SwedbankPay/fix/SPMVersionNumbers
Browse files Browse the repository at this point in the history
Fix/spm version numbers
  • Loading branch information
OlofT authored Jun 30, 2022
2 parents 8f3a87e + 604999d commit e6746ca
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions SwedbankPaySDK/Classes/Models/VersionReporter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@ import Foundation

extension SwedbankPaySDK {

/// Keep track of current version and
/// Keep track of current version and build user agent string
public struct VersionReporter {

public static var currentVersion: String? = {
let bundle = Bundle(for: SwedbankPaySDK.self)
return bundle.infoDictionary?["CFBundleShortVersionString"] as? String
}()
/// This number must match git's release-tag, pre-releases should be marked with "-alpha"
/// It can't be read from info.plist since SPM does not have those.
public static var currentVersion = "3.1.1"

/// We store the SDK version in the bundle for easy access
/// User agent reports version and platform
public static var userAgent: String = {
"SwedbankPaySDK-iOS/\(currentVersion ?? "Unknown")"
"SwedbankPaySDK-iOS/\(currentVersion)"
}()
}
}

0 comments on commit e6746ca

Please sign in to comment.