Set peer-info version from bundle

Omit build number for now, seems more complex than expected to
accomplish with CocoaPods.
This commit is contained in:
Davide De Rosa 2018-09-23 15:29:40 +02:00
parent 4cbf935dea
commit 24dabe2739
1 changed files with 14 additions and 1 deletions

View File

@ -40,7 +40,20 @@ import __TunnelKitNative
struct CoreConfiguration {
static let identifier = "com.algoritmico.TunnelKit"
static let version = "1.1.0-dev"
static let version: String = {
let bundle = Bundle(for: SessionProxy.self)
guard let info = bundle.infoDictionary else {
return ""
}
// guard let version = info["CFBundleShortVersionString"] as? String else {
// return ""
// }
// guard let build = info["CFBundleVersion"] as? String else {
// return version
// }
// return "\(version) (\(build))"
return info["CFBundleShortVersionString"] as? String ?? ""
}()
// MARK: Session