Skip to content

Commit 04884e9

Browse files
authored
Merge pull request #78 from loudnate/remote-settings
Removes support for RemoteSettings.plist
2 parents 34532f9 + aca213e commit 04884e9

File tree

5 files changed

+2
-66
lines changed

5 files changed

+2
-66
lines changed

Loop.xcodeproj/project.pbxproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
43B371861CE583890013C5A6 /* BasalStateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43B371851CE583890013C5A6 /* BasalStateView.swift */; };
8484
43B371881CE597D10013C5A6 /* ShareClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43B371871CE597D10013C5A6 /* ShareClient.framework */; };
8585
43C0944A1CACCC73001F6403 /* NotificationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43C094491CACCC73001F6403 /* NotificationManager.swift */; };
86-
43C418B31CE0550100405B6A /* NSBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43E344A51B9E1B3300C85C07 /* NSBundle.swift */; };
8786
43C418B51CE0575200405B6A /* ShareGlucose+GlucoseKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43C418B41CE0575200405B6A /* ShareGlucose+GlucoseKit.swift */; };
8887
43CA93371CB98079000026B5 /* MinimedKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43CA93361CB98079000026B5 /* MinimedKit.framework */; };
8988
43CE7CDE1CA8B63E003CC1B0 /* NSDate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43CE7CDD1CA8B63E003CC1B0 /* NSDate.swift */; };
@@ -120,7 +119,6 @@
120119
43E2D9191D222759004DA55F /* LoopKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43F78D4B1C914197002152D1 /* LoopKit.framework */; };
121120
43E3449F1B9D68E900C85C07 /* StatusTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43E3449E1B9D68E900C85C07 /* StatusTableViewController.swift */; };
122121
43E344A41B9E1B1C00C85C07 /* NSUserDefaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43E344A31B9E1B1C00C85C07 /* NSUserDefaults.swift */; };
123-
43E344A61B9E1B3300C85C07 /* NSBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43E344A51B9E1B3300C85C07 /* NSBundle.swift */; };
124122
43EB40861C82646A00472A8C /* StatusChartManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43EB40851C82646A00472A8C /* StatusChartManager.swift */; };
125123
43EDDBF31C361C75007D89B5 /* xDripG5.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43EDDBF11C361C75007D89B5 /* xDripG5.framework */; };
126124
43F41C331D3A17AA00C11ED6 /* ChartAxisValueDoubleUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43F41C321D3A17AA00C11ED6 /* ChartAxisValueDoubleUnit.swift */; };
@@ -329,7 +327,6 @@
329327
43E2D90F1D20C581004DA55F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
330328
43E3449E1B9D68E900C85C07 /* StatusTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = StatusTableViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
331329
43E344A31B9E1B1C00C85C07 /* NSUserDefaults.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSUserDefaults.swift; sourceTree = "<group>"; };
332-
43E344A51B9E1B3300C85C07 /* NSBundle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSBundle.swift; sourceTree = "<group>"; };
333330
43EB40851C82646A00472A8C /* StatusChartManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatusChartManager.swift; sourceTree = "<group>"; };
334331
43EDDBF01C361C75007D89B5 /* CommonCrypto.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CommonCrypto.framework; path = Carthage/Build/iOS/CommonCrypto.framework; sourceTree = "<group>"; };
335332
43EDDBF11C361C75007D89B5 /* xDripG5.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = xDripG5.framework; path = Carthage/Build/iOS/xDripG5.framework; sourceTree = "<group>"; };
@@ -578,7 +575,6 @@
578575
43649A621C7A347F00523D7F /* CollectionType.swift */,
579576
434FF1E91CF26C29000DB779 /* IdentifiableClass.swift */,
580577
434F54561D287FDB002A9274 /* NibLoadable.swift */,
581-
43E344A51B9E1B3300C85C07 /* NSBundle.swift */,
582578
43CE7CDD1CA8B63E003CC1B0 /* NSDate.swift */,
583579
4398973A1CD2FC2000223065 /* NSDateFormatter.swift */,
584580
439897341CD2F7DE00223065 /* NSTimeInterval.swift */,
@@ -969,7 +965,6 @@
969965
437CEEBE1CD6E0CB003C8C80 /* LoopCompletionHUDView.swift in Sources */,
970966
435400321C9F745500D5819C /* BolusSuggestionUserInfo.swift in Sources */,
971967
43E3449F1B9D68E900C85C07 /* StatusTableViewController.swift in Sources */,
972-
43E344A61B9E1B3300C85C07 /* NSBundle.swift in Sources */,
973968
43DBF0531C93EC8200B3C386 /* DeviceDataManager.swift in Sources */,
974969
43E2D8C81D208D5B004DA55F /* KeychainManager+Loop.swift in Sources */,
975970
4346D1E71C77F5FE00ABAFE3 /* ChartTableViewCell.swift in Sources */,
@@ -1039,7 +1034,6 @@
10391034
43DE925A1C5479E4001FFDE1 /* CarbEntryUserInfo.swift in Sources */,
10401035
4328E0301CFBFAEB00E199AA /* NSTimeInterval.swift in Sources */,
10411036
43A9438E1B926B7B0051FA24 /* ComplicationController.swift in Sources */,
1042-
43C418B31CE0550100405B6A /* NSBundle.swift in Sources */,
10431037
4328E01A1CFBE1DA00E199AA /* StatusInterfaceController.swift in Sources */,
10441038
43DE925D1C547A20001FFDE1 /* WatchContext.swift in Sources */,
10451039
435400351C9F878D00D5819C /* SetBolusUserInfo.swift in Sources */,

Loop/Extensions/NSBundle.swift

Lines changed: 0 additions & 27 deletions
This file was deleted.

Loop/Managers/AnalyticsManager.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,8 @@ class AnalyticsManager {
1919
}
2020

2121
init() {
22-
// Migrate RemoteSettings.plist to the Keychain
23-
let keychain = KeychainManager()
24-
25-
if let APIKey = keychain.getAmplitudeAPIKey() {
22+
if let APIKey = KeychainManager().getAmplitudeAPIKey() {
2623
amplitudeService = AmplitudeService(APIKey: APIKey)
27-
} else if let settings = NSBundle.mainBundle().remoteSettings, key = settings["AmplitudeAPIKey"] where !key.isEmpty {
28-
try! keychain.setAmplitudeAPIKey(key)
29-
amplitudeService = AmplitudeService(APIKey: key)
3024
} else {
3125
amplitudeService = AmplitudeService(APIKey: nil)
3226
}

Loop/Managers/DiagnosticLogger.swift

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,7 @@ class DiagnosticLogger {
1919
}
2020

2121
init() {
22-
let keychain = KeychainManager()
23-
24-
// Migrate RemoteSettings.plist to the Keychain
25-
if let (databaseName, APIKey) = keychain.getMLabCredentials() {
26-
mLabService = MLabService(databaseName: databaseName, APIKey: APIKey)
27-
} else if let settings = NSBundle.mainBundle().remoteSettings,
28-
APIKey = settings["mLabAPIKey"],
29-
APIPath = settings["mLabAPIPath"] where !APIKey.isEmpty
30-
{
31-
let databaseName = APIPath.componentsSeparatedByString("/")[1]
32-
try! keychain.setMLabDatabaseName(databaseName, APIKey: APIKey)
22+
if let (databaseName, APIKey) = KeychainManager().getMLabCredentials() {
3323
mLabService = MLabService(databaseName: databaseName, APIKey: APIKey)
3424
} else {
3525
mLabService = MLabService(databaseName: nil, APIKey: nil)

Loop/Managers/RemoteDataManager.swift

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,14 @@ class RemoteDataManager {
3636
private let keychain = KeychainManager()
3737

3838
init() {
39-
// Migrate RemoteSettings.plist to the Keychain
40-
let settings = NSBundle.mainBundle().remoteSettings
41-
4239
if let (username, password) = keychain.getDexcomShareCredentials() {
4340
shareService = ShareService(username: username, password: password)
44-
} else if let username = settings?["ShareAccountName"],
45-
password = settings?["ShareAccountPassword"]
46-
where !username.isEmpty && !password.isEmpty
47-
{
48-
try! keychain.setDexcomShareUsername(username, password: password)
49-
shareService = ShareService(username: username, password: password)
5041
} else {
5142
shareService = ShareService(username: nil, password: nil)
5243
}
5344

5445
if let (siteURL, APISecret) = keychain.getNightscoutCredentials() {
5546
nightscoutService = NightscoutService(siteURL: siteURL, APISecret: APISecret)
56-
} else if let siteURLString = settings?["NightscoutSiteURL"],
57-
APISecret = settings?["NightscoutAPISecret"],
58-
siteURL = NSURL(string: siteURLString)
59-
{
60-
keychain.setNightscoutURL(siteURL, secret: APISecret)
61-
nightscoutService = NightscoutService(siteURL: siteURL, APISecret: APISecret)
6247
} else {
6348
nightscoutService = NightscoutService(siteURL: nil, APISecret: nil)
6449
}

0 commit comments

Comments
 (0)