Skip to content
Snippets Groups Projects
Commit 9aed43d1 authored by Bruno Muniz's avatar Bruno Muniz :apple:
Browse files

Add pre-actions for run and archive on release scheme

parent bc604feb
No related branches found
No related tags found
2 merge requests!71Releasing v1.1.5 (214),!70Add user defaults flag for reporting enabled and reporting optional
<?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&#10;/usr/libexec/PlistBuddy -c &quot;Set :isReportingOptional YES&quot; &quot;${SRCROOT}/client-ios/Resources/Info.plist&quot;&#10;">
<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&#10;/usr/libexec/PlistBuddy -c &quot;Set :isReportingOptional NO&quot; &quot;${SRCROOT}/client-ios/Resources/Info.plist&quot;&#10;">
<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>
......@@ -104,5 +104,7 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
<key>isReportingOptional</key>
<false/>
</dict>
</plist>
......@@ -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 {
......
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment