mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Add support for reading accounts from Element Classic.
This commit is contained in:
@@ -23,6 +23,10 @@ struct InfoPlistReader {
|
||||
static let bundleURLTypes = "CFBundleURLTypes"
|
||||
static let bundleURLName = "CFBundleURLName"
|
||||
static let bundleURLSchemes = "CFBundleURLSchemes"
|
||||
|
||||
static let classicAppGroupIdentifier = "classicAppGroupIdentifier"
|
||||
static let classicAppKeychainServiceIdentifier = "classicAppKeychainServiceIdentifier"
|
||||
static let classicAppKeychainAccessGroupIdentifier = "classicAppKeychainAccessGroupIdentifier"
|
||||
}
|
||||
|
||||
private enum Values {
|
||||
@@ -115,8 +119,23 @@ struct InfoPlistReader {
|
||||
return utType.lowercased()
|
||||
}
|
||||
|
||||
// MARK: - Sign in with Classic app
|
||||
|
||||
var classicAppGroupIdentifier: String? {
|
||||
infoPlistValue(forKey: Keys.classicAppGroupIdentifier)
|
||||
}
|
||||
|
||||
var classicAppKeychainServiceIdentifier: String? {
|
||||
infoPlistValue(forKey: Keys.classicAppKeychainServiceIdentifier)
|
||||
}
|
||||
|
||||
var classicAppKeychainAccessGroupIdentifier: String? {
|
||||
infoPlistValue(forKey: Keys.classicAppKeychainAccessGroupIdentifier)
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
@_disfavoredOverload // Make sure optional types default to the optional version below.
|
||||
private func infoPlistValue<T>(forKey key: String) -> T {
|
||||
guard let result = bundle.object(forInfoDictionaryKey: key) as? T else {
|
||||
fatalError("Add \(key) into your target's Info.plst")
|
||||
@@ -124,6 +143,10 @@ struct InfoPlistReader {
|
||||
return result
|
||||
}
|
||||
|
||||
private func infoPlistValue<T>(forKey key: String) -> T? {
|
||||
bundle.object(forInfoDictionaryKey: key) as? T
|
||||
}
|
||||
|
||||
private func customSchemeForName(_ name: String) -> String {
|
||||
let urlTypes: [[String: Any]] = infoPlistValue(forKey: Keys.bundleURLTypes)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user