diff --git a/App/client-ios.xcodeproj/xcshareddata/xcschemes/Release.xcscheme b/App/client-ios.xcodeproj/xcshareddata/xcschemes/Release.xcscheme index 0465975370687b0d9f8df4aa241468f8387aa35f..800c200df2b4ad94d75e5144e7951bdcd91611f2 100644 --- a/App/client-ios.xcodeproj/xcshareddata/xcschemes/Release.xcscheme +++ b/App/client-ios.xcodeproj/xcshareddata/xcschemes/Release.xcscheme @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <Scheme LastUpgradeVersion = "1200" - version = "1.3"> + version = "1.7"> <BuildAction parallelizeBuildables = "YES" buildImplicitDependencies = "YES"> @@ -52,6 +52,24 @@ migratedStopOnEveryIssue = "YES" debugServiceExtension = "internal" allowLocationSimulation = "YES"> + <PreActions> + <ExecutionAction + ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction"> + <ActionContent + title = "Run Script" + scriptText = "#!/bin/sh /usr/libexec/PlistBuddy -c "Set :isReportingOptional YES" "${SRCROOT}/client-ios/Resources/Info.plist" "> + <EnvironmentBuildable> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "02FDD06121EDA39A000F1286" + BuildableName = "client-ios.app" + BlueprintName = "client-ios" + ReferencedContainer = "container:client-ios.xcodeproj"> + </BuildableReference> + </EnvironmentBuildable> + </ActionContent> + </ExecutionAction> + </PreActions> <BuildableProductRunnable runnableDebuggingMode = "0"> <BuildableReference @@ -91,5 +109,23 @@ <ArchiveAction buildConfiguration = "Release" revealArchiveInOrganizer = "YES"> + <PreActions> + <ExecutionAction + ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction"> + <ActionContent + title = "Run Script" + scriptText = "#!/bin/sh /usr/libexec/PlistBuddy -c "Set :isReportingOptional NO" "${SRCROOT}/client-ios/Resources/Info.plist" "> + <EnvironmentBuildable> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "02FDD06121EDA39A000F1286" + BuildableName = "client-ios.app" + BlueprintName = "client-ios" + ReferencedContainer = "container:client-ios.xcodeproj"> + </BuildableReference> + </EnvironmentBuildable> + </ActionContent> + </ExecutionAction> + </PreActions> </ArchiveAction> </Scheme> diff --git a/App/client-ios/Resources/Info.plist b/App/client-ios/Resources/Info.plist index dd578c50c07a9aef6e5edff517adeffcbe4be8ca..d8cb845b40392068f453251c9c0aa72cd00979db 100644 --- a/App/client-ios/Resources/Info.plist +++ b/App/client-ios/Resources/Info.plist @@ -104,5 +104,7 @@ </array> <key>UIViewControllerBasedStatusBarAppearance</key> <true/> + <key>isReportingOptional</key> + <false/> </dict> </plist> diff --git a/Sources/App/AppDelegate.swift b/Sources/App/AppDelegate.swift index 4143a5f270c7179e9f11892702bf7f7db79a6800..e9c2b74492e8944542053bed00b4544dbe182970 100644 --- a/Sources/App/AppDelegate.swift +++ b/Sources/App/AppDelegate.swift @@ -23,6 +23,7 @@ public class AppDelegate: UIResponder, UIApplicationDelegate { @KeyObject(.hideAppList, defaultValue: false) var hideAppList: Bool @KeyObject(.recordingLogs, defaultValue: true) var recordingLogs: Bool @KeyObject(.crashReporting, defaultValue: true) var isCrashReportingEnabled: Bool + @KeyObject(.isReportingOptional, defaultValue: false) var isReportingOptional: Bool var calledStopNetwork = false var forceFailedPendingMessages = false @@ -48,6 +49,8 @@ public class AppDelegate: UIResponder, UIApplicationDelegate { crashReporter.configure() crashReporter.setEnabled(isCrashReportingEnabled) + isReportingOptional = isReportingFeatureOptionalOnInfoPlist() + UNUserNotificationCenter.current().delegate = self let window = Window() @@ -175,6 +178,17 @@ func getUsernameFromInvitationDeepLink(_ url: URL) -> String? { return nil } +func isReportingFeatureOptionalOnInfoPlist() -> Bool { + struct Root : Decodable { + let isReportingOptional : Bool + } + + let url = Bundle.main.url(forResource: "Info", withExtension: "plist")! + let data = try! Data(contentsOf: url) + let result = try! PropertyListDecoder().decode(Root.self, from: data) + return result.isReportingOptional +} + // MARK: Notifications extension AppDelegate: UNUserNotificationCenterDelegate { diff --git a/Sources/SettingsFeature/ViewModels/SettingsAdvancedViewModel.swift b/Sources/SettingsFeature/ViewModels/SettingsAdvancedViewModel.swift index 60e7f5e777c700efbd5074c0176d5a217bc4a3b2..c88dba702d309979cac8ab47466e8dfefb32381e 100644 --- a/Sources/SettingsFeature/ViewModels/SettingsAdvancedViewModel.swift +++ b/Sources/SettingsFeature/ViewModels/SettingsAdvancedViewModel.swift @@ -18,7 +18,7 @@ final class SettingsAdvancedViewModel { @KeyObject(.crashReporting, defaultValue: true) var isCrashReporting: Bool @KeyObject(.isReportingEnabled, defaultValue: true) var isReportingEnabled: Bool - @KeyObject(.isReportingOptional, defaultValue: true) var isReportingOptional: Bool + @KeyObject(.isReportingOptional, defaultValue: false) var isReportingOptional: Bool private let isShowingUsernamesKey = "isShowingUsernames"