Skip to content

Commit f54695d

Browse files
author
Rick Pasetto
authored
LOOP-1114: Refactor version checking into SupportUI and adds new SupportManager (#467)
* async/await! * Adds software update view and App Store version check service * ckpt * ckpt * ckpt * checkpoint: with alerts, kinda like it * alert cadence every 2 weeks * Add unit test for alert * PR Feedback: move AppStoreVersionCheckService to TidepoolService * Checkpoint: major rework of views into VersionCheckServiceUI * LOOP-1114: Checkpoint: move VersionCheckServiceUI implementation to TidepoolService * rename * checkpoint: move all of the VersionCheck stuff into SupportUI * restorestate * Only add MockSupport iff `allowSimulators` * Minor rearrangements * Move/fix unit tests * ckpt * PR Feedback
1 parent 4be25ae commit f54695d

21 files changed

+603
-649
lines changed

Common/Extensions/NSBundle.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ extension Bundle {
3636
var appGroupSuiteName: String {
3737
return object(forInfoDictionaryKey: "AppGroupIdentifier") as! String
3838
}
39+
40+
var appStoreURL: String? {
41+
return object(forInfoDictionaryKey: "AppStoreURL") as? String
42+
}
3943

4044
var isAppExtension: Bool {
4145
return bundleURL.pathExtension == "appex"

Loop.xcconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ MAIN_APP_DISPLAY_NAME = Loop
1616
// Appication icon [DEFAULT]
1717
APPICON_NAME = AppIcon
1818

19+
// App Store URL
20+
APP_STORE_URL =
21+
1922
// Features [DEFAULT]
2023
SWIFT_ACTIVE_COMPILATION_CONDITIONS = $(inherited)
2124

Loop.xcodeproj/project.pbxproj

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
1D4990E824A25931005CC357 /* FeatureFlags.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89E267FB2292456700A3F2AF /* FeatureFlags.swift */; };
3434
1D4A3E2D2478628500FD601B /* StoredAlert+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D4A3E2B2478628500FD601B /* StoredAlert+CoreDataClass.swift */; };
3535
1D4A3E2E2478628500FD601B /* StoredAlert+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D4A3E2C2478628500FD601B /* StoredAlert+CoreDataProperties.swift */; };
36-
1D63DEA526E950D400F46FA5 /* VersionCheckServicesManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D63DEA426E950D400F46FA5 /* VersionCheckServicesManager.swift */; };
36+
1D63DEA526E950D400F46FA5 /* SupportManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D63DEA426E950D400F46FA5 /* SupportManager.swift */; };
3737
1D6B1B6726866D89009AC446 /* AlertPermissionsChecker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D6B1B6626866D89009AC446 /* AlertPermissionsChecker.swift */; };
38-
1D70C40126EC0F9D00C62570 /* VersionCheckServicesManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D70C40026EC0F9D00C62570 /* VersionCheckServicesManagerTests.swift */; };
38+
1D70C40126EC0F9D00C62570 /* SupportManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D70C40026EC0F9D00C62570 /* SupportManagerTests.swift */; };
3939
1D80313D24746274002810DF /* AlertStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D80313C24746274002810DF /* AlertStoreTests.swift */; };
4040
1D82E6A025377C6B009131FB /* TrustedTimeChecker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D82E69F25377C6B009131FB /* TrustedTimeChecker.swift */; };
4141
1D8D55BC252274650044DBB6 /* BolusEntryViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D8D55BB252274650044DBB6 /* BolusEntryViewModelTests.swift */; };
@@ -46,6 +46,7 @@
4646
1DA7A84424477698008257F0 /* InAppModalAlertIssuerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DA7A84324477698008257F0 /* InAppModalAlertIssuerTests.swift */; };
4747
1DB1065124467E18005542BD /* AlertManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DB1065024467E18005542BD /* AlertManager.swift */; };
4848
1DB1CA4D24A55F0000B3B94C /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DB1CA4C24A55F0000B3B94C /* Image.swift */; };
49+
1DB619AC270BAD3D006C9D07 /* VersionUpdateViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DB619AB270BAD3D006C9D07 /* VersionUpdateViewModel.swift */; };
4950
1DC63E7425351BDF004605DA /* TrueTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DC63E7325351BDF004605DA /* TrueTime.framework */; };
5051
1DD0B76724EC77AC008A2DC3 /* SupportScreenView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DD0B76624EC77AC008A2DC3 /* SupportScreenView.swift */; };
5152
1DDE273D24AEA4B000796622 /* SettingsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DB1CA4E24A56D7600B3B94C /* SettingsViewModel.swift */; };
@@ -781,9 +782,9 @@
781782
1D49795724E7289700948F05 /* ServicesViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServicesViewModel.swift; sourceTree = "<group>"; };
782783
1D4A3E2B2478628500FD601B /* StoredAlert+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "StoredAlert+CoreDataClass.swift"; sourceTree = "<group>"; };
783784
1D4A3E2C2478628500FD601B /* StoredAlert+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "StoredAlert+CoreDataProperties.swift"; sourceTree = "<group>"; };
784-
1D63DEA426E950D400F46FA5 /* VersionCheckServicesManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VersionCheckServicesManager.swift; sourceTree = "<group>"; };
785+
1D63DEA426E950D400F46FA5 /* SupportManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SupportManager.swift; sourceTree = "<group>"; };
785786
1D6B1B6626866D89009AC446 /* AlertPermissionsChecker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertPermissionsChecker.swift; sourceTree = "<group>"; };
786-
1D70C40026EC0F9D00C62570 /* VersionCheckServicesManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VersionCheckServicesManagerTests.swift; sourceTree = "<group>"; };
787+
1D70C40026EC0F9D00C62570 /* SupportManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SupportManagerTests.swift; sourceTree = "<group>"; };
787788
1D80313C24746274002810DF /* AlertStoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertStoreTests.swift; sourceTree = "<group>"; };
788789
1D82E69F25377C6B009131FB /* TrustedTimeChecker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrustedTimeChecker.swift; sourceTree = "<group>"; };
789790
1D8D55BB252274650044DBB6 /* BolusEntryViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BolusEntryViewModelTests.swift; sourceTree = "<group>"; };
@@ -796,6 +797,7 @@
796797
1DB1065024467E18005542BD /* AlertManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlertManager.swift; sourceTree = "<group>"; };
797798
1DB1CA4C24A55F0000B3B94C /* Image.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Image.swift; sourceTree = "<group>"; };
798799
1DB1CA4E24A56D7600B3B94C /* SettingsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewModel.swift; sourceTree = "<group>"; };
800+
1DB619AB270BAD3D006C9D07 /* VersionUpdateViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VersionUpdateViewModel.swift; sourceTree = "<group>"; };
799801
1DC63E7325351BDF004605DA /* TrueTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = TrueTime.framework; path = Carthage/Build/iOS/TrueTime.framework; sourceTree = "<group>"; };
800802
1DD0B76624EC77AC008A2DC3 /* SupportScreenView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SupportScreenView.swift; sourceTree = "<group>"; };
801803
1DE09BA824A3E23F009EE9F9 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
@@ -1642,7 +1644,7 @@
16421644
A91E4C2224F86F1000BE9213 /* CriticalEventLogExportManagerTests.swift */,
16431645
C16B983F26B4898800256B05 /* DoseEnactorTests.swift */,
16441646
E9C58A7124DB489100487A17 /* LoopDataManagerTests.swift */,
1645-
1D70C40026EC0F9D00C62570 /* VersionCheckServicesManagerTests.swift */,
1647+
1D70C40026EC0F9D00C62570 /* SupportManagerTests.swift */,
16461648
A9F5F1F4251050EC00E7C8A4 /* ZipArchiveTests.swift */,
16471649
);
16481650
path = Managers;
@@ -2053,28 +2055,28 @@
20532055
43F5C2CF1B92A2ED003EB13D /* Views */ = {
20542056
isa = PBXGroup;
20552057
children = (
2056-
C1DE5D22251BFC4D00439E49 /* SimpleBolusView.swift */,
20572058
897A5A9524C2175B00C4E71D /* BolusEntryView.swift */,
20582059
C1F8B1D122375E4200DD66CF /* BolusProgressTableViewCell.swift */,
20592060
C1F8B1DB223862D500DD66CF /* BolusProgressTableViewCell.xib */,
20602061
43B260481ED248FB008CAA77 /* CarbEntryTableViewCell.swift */,
20612062
431A8C3F1EC6E8AB00823B9C /* CircleMaskView.swift */,
20622063
A9A056B224B93C62007CF06D /* CriticalEventLogExportView.swift */,
2064+
C191D2A025B3ACAA00C26C0B /* DosingStrategySelectionView.swift */,
20632065
43D381611EBD9759007F8C8F /* HeaderValuesTableViewCell.swift */,
20642066
430D85881F44037000AF2D4F /* HUDViewTableViewCell.swift */,
20652067
A91D2A3E26CF0FF80023B075 /* IconTitleSubtitleTableViewCell.swift */,
2068+
C1742331259BEADC00399C9D /* ManualEntryDoseView.swift */,
20662069
1DA46B5F2492E2E300D71A63 /* NotificationsCriticalAlertPermissionsView.swift */,
20672070
899433B723FE129700FA4BEA /* OverrideBadgeView.swift */,
20682071
89D6953D23B6DF8A002B3066 /* PotentialCarbEntryTableViewCell.swift */,
20692072
89CAB36224C8FE95009EE3CE /* PredictedGlucoseChartView.swift */,
20702073
438D42FA1D7D11A4003244B0 /* PredictionInputEffectTableViewCell.swift */,
20712074
439706E522D2E84900C81566 /* PredictionSettingTableViewCell.swift */,
20722075
1DE09BA824A3E23F009EE9F9 /* SettingsView.swift */,
2076+
C1DE5D22251BFC4D00439E49 /* SimpleBolusView.swift */,
20732077
1DD0B76624EC77AC008A2DC3 /* SupportScreenView.swift */,
20742078
43F64DD81D9C92C900D24DC6 /* TitleSubtitleTableViewCell.swift */,
20752079
4311FB9A1F37FE1B00D4C0A7 /* TitleSubtitleTextFieldTableViewCell.swift */,
2076-
C1742331259BEADC00399C9D /* ManualEntryDoseView.swift */,
2077-
C191D2A025B3ACAA00C26C0B /* DosingStrategySelectionView.swift */,
20782080
);
20792081
path = Views;
20802082
sourceTree = "<group>";
@@ -2104,10 +2106,10 @@
21042106
A9C62D872331703000535612 /* ServicesManager.swift */,
21052107
E9BB27AA23B85C3500FB4987 /* SleepStore.swift */,
21062108
43FCEEA8221A615B0013DD30 /* StatusChartsManager.swift */,
2109+
1D63DEA426E950D400F46FA5 /* SupportManager.swift */,
21072110
4F70C20F1DE8FAC5006380B7 /* ExtensionDataManager.swift */,
21082111
89ADE13A226BFA0F0067222B /* TestingScenariosManager.swift */,
21092112
1D82E69F25377C6B009131FB /* TrustedTimeChecker.swift */,
2110-
1D63DEA426E950D400F46FA5 /* VersionCheckServicesManager.swift */,
21112113
4328E0341CFC0AE100E199AA /* WatchDataManager.swift */,
21122114
1DA6499D2441266400F61E75 /* Alerts */,
21132115
E95D37FF24EADE68005E2F50 /* Store Protocols */,
@@ -2393,6 +2395,7 @@
23932395
1DB1CA4E24A56D7600B3B94C /* SettingsViewModel.swift */,
23942396
1D49795724E7289700948F05 /* ServicesViewModel.swift */,
23952397
C174233B259BEB0F00399C9D /* ManualEntryDoseViewModel.swift */,
2398+
1DB619AB270BAD3D006C9D07 /* VersionUpdateViewModel.swift */,
23962399
);
23972400
path = "View Models";
23982401
sourceTree = "<group>";
@@ -3525,6 +3528,7 @@
35253528
A9CBE458248AB564008E7BA2 /* DoseStore+SimulatedCoreData.swift in Sources */,
35263529
897A5A9924C22DE800C4E71D /* BolusEntryViewModel.swift in Sources */,
35273530
4374B5EF209D84BF00D17AA8 /* OSLog.swift in Sources */,
3531+
1DB619AC270BAD3D006C9D07 /* VersionUpdateViewModel.swift in Sources */,
35283532
A9C62D882331703100535612 /* Service.swift in Sources */,
35293533
89CAB36324C8FE96009EE3CE /* PredictedGlucoseChartView.swift in Sources */,
35303534
4F6663941E905FD2009E74FC /* ChartColorPalette+Loop.swift in Sources */,
@@ -3543,7 +3547,7 @@
35433547
899433B823FE129800FA4BEA /* OverrideBadgeView.swift in Sources */,
35443548
89D1503E24B506EB00EDE253 /* Dictionary.swift in Sources */,
35453549
4302F4E31D4EA54200F0FCAF /* InsulinDeliveryTableViewController.swift in Sources */,
3546-
1D63DEA526E950D400F46FA5 /* VersionCheckServicesManager.swift in Sources */,
3550+
1D63DEA526E950D400F46FA5 /* SupportManager.swift in Sources */,
35473551
4FC8C8011DEB93E400A1452E /* NSUserDefaults+StatusExtension.swift in Sources */,
35483552
43E93FB61E469A4000EAB8DB /* NumberFormatter.swift in Sources */,
35493553
C1FB428C217806A400FAB378 /* StateColorPalette.swift in Sources */,
@@ -3810,7 +3814,7 @@
38103814
C16575732538AFF6004AE16E /* CGMStalenessMonitorTests.swift in Sources */,
38113815
A9E6DFEA246A0448005B1A1C /* PumpManagerErrorTests.swift in Sources */,
38123816
1DA7A84424477698008257F0 /* InAppModalAlertIssuerTests.swift in Sources */,
3813-
1D70C40126EC0F9D00C62570 /* VersionCheckServicesManagerTests.swift in Sources */,
3817+
1D70C40126EC0F9D00C62570 /* SupportManagerTests.swift in Sources */,
38143818
E93E86A824DDCC4400FF40C8 /* MockDoseStore.swift in Sources */,
38153819
E98A55F124EDD85E0008715D /* MockDosingDecisionStore.swift in Sources */,
38163820
8968B114240C55F10074BB48 /* LoopSettingsTests.swift in Sources */,

Loop.xcodeproj/xcshareddata/xcschemes/Complication - WatchApp.xcscheme

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

0 commit comments

Comments
 (0)