Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

Commit 315b059

Browse files
authored
Fixes #2995 - Include Secret Settings to validate the Sentry integration (#2996)
1 parent 8c50625 commit 315b059

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

Blockzilla.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@
226226
F861799D2795EE9800CFD324 /* InternalExperimentDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F861799C2795EE9800CFD324 /* InternalExperimentDetailView.swift */; };
227227
F861799F27961F4200CFD324 /* InternalSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = F861799E27961F4200CFD324 /* InternalSettings.swift */; };
228228
F86D00612790978700E83177 /* InternalSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F86D00602790978700E83177 /* InternalSettingsView.swift */; };
229+
F8714D2127A1E1F400CEB695 /* InternalCrashReportingSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8714D2027A1E1F400CEB695 /* InternalCrashReportingSettingsView.swift */; };
229230
F8B92FBE279EC73700183998 /* Sentry in Frameworks */ = {isa = PBXBuildFile; productRef = F8B92FBD279EC73700183998 /* Sentry */; };
230231
F8BC6A0727224B170026AB9F /* NimbusExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8BC6A0627224B170026AB9F /* NimbusExtensions.swift */; };
231232
F8BC6A0927224B890026AB9F /* NimbusWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8BC6A0827224B890026AB9F /* NimbusWrapper.swift */; };
@@ -1009,6 +1010,7 @@
10091010
F861799C2795EE9800CFD324 /* InternalExperimentDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InternalExperimentDetailView.swift; sourceTree = "<group>"; };
10101011
F861799E27961F4200CFD324 /* InternalSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InternalSettings.swift; sourceTree = "<group>"; };
10111012
F86D00602790978700E83177 /* InternalSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InternalSettingsView.swift; sourceTree = "<group>"; };
1013+
F8714D2027A1E1F400CEB695 /* InternalCrashReportingSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InternalCrashReportingSettingsView.swift; sourceTree = "<group>"; };
10121014
F8820C7126E19B1E006AB3B8 /* en-GB */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-GB"; path = "en-GB.lproj/Intro.strings"; sourceTree = "<group>"; };
10131015
F8820C7226E19B1E006AB3B8 /* en-GB */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-GB"; path = "en-GB.lproj/Intents.strings"; sourceTree = "<group>"; };
10141016
F8820C7326E19B1E006AB3B8 /* en-GB */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-GB"; path = "en-GB.lproj/InfoPlist.strings"; sourceTree = "<group>"; };
@@ -1592,6 +1594,7 @@
15921594
F861799E27961F4200CFD324 /* InternalSettings.swift */,
15931595
F86D00602790978700E83177 /* InternalSettingsView.swift */,
15941596
F861799A2795D95E00CFD324 /* InternalExperimentsSettingsView.swift */,
1597+
F8714D2027A1E1F400CEB695 /* InternalCrashReportingSettingsView.swift */,
15951598
F861799C2795EE9800CFD324 /* InternalExperimentDetailView.swift */,
15961599
D5D067FA252F945D00C35227 /* metrics.yaml */,
15971600
);
@@ -2270,6 +2273,7 @@
22702273
D3561B2B1DB5925100A5EEAF /* GradientBackgroundView.swift in Sources */,
22712274
C82D143026EF62BE007B275C /* TipsPageViewController.swift in Sources */,
22722275
C8337DF42710898800093D42 /* ImageLoader.swift in Sources */,
2276+
F8714D2127A1E1F400CEB695 /* InternalCrashReportingSettingsView.swift in Sources */,
22732277
F8BC6A0727224B170026AB9F /* NimbusExtensions.swift in Sources */,
22742278
C8415DB326E9FA38008BAAA2 /* UIApplication+Orientation.swift in Sources */,
22752279
60D779C327469A2300DF8047 /* DesignSystem.swift in Sources */,
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4+
5+
import SwiftUI
6+
import Sentry
7+
8+
struct InternalCrashReportingSettingsView: View {
9+
var body: some View {
10+
Form {
11+
SwiftUI.Section(header: Text("Crash Triggers")) {
12+
Button("SentrySDK.crash()") {
13+
SentrySDK.crash()
14+
}
15+
Button("SentrySDK.capture(message:)") {
16+
SentrySDK.capture(message: "Test")
17+
}
18+
Button("SentrySDK.capture(exception:)") {
19+
SentrySDK.capture(exception: NSException(name: .genericException, reason: "Test Exception", userInfo: ["UserInfo": "Something"]))
20+
}
21+
Button("SentrySDK.capture(error:)") {
22+
SentrySDK.capture(error: NSError(domain: "TestDomain", code: 42, userInfo: ["UserInfo": "Something"]))
23+
}
24+
}
25+
}.navigationBarTitle("Crash Reporting Settings")
26+
}
27+
}
28+
29+
struct InternalCrashReportingSettingsView_Previews: PreviewProvider {
30+
static var previews: some View {
31+
InternalCrashReportingSettingsView()
32+
}
33+
}

Blockzilla/InternalSettingsView.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ struct InternalSettingsView: View {
1212
InternalExperimentsSettingsView(availableExperiments: NimbusWrapper.shared.getAvailableExperiments())
1313
}
1414
}
15+
SwiftUI.Section {
16+
NavigationLink("Crash Reporting") {
17+
InternalCrashReportingSettingsView()
18+
}
19+
}
1520
SwiftUI.Section {
1621
Text("The settings in this section are used by Focus developers and testers.")
1722
.font(.caption)

0 commit comments

Comments
 (0)