Skip to content

Commit

Permalink
test: invert launch arg so feedback widget is injected by default (#4901
Browse files Browse the repository at this point in the history
)
  • Loading branch information
armcknight authored Feb 26, 2025
1 parent 111ea41 commit ebf1c9c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@
ReferencedContainer = "container:iOS-ObjectiveC.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "--io.sentry.feedback.no-auto-inject-widget"
isEnabled = "NO">
</CommandLineArgument>
</CommandLineArguments>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
6 changes: 3 additions & 3 deletions Samples/iOS-ObjectiveC/iOS-ObjectiveC/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ - (BOOL)application:(UIApplication *)application
config.useShakeGesture = YES;
config.showFormForScreenshots = YES;
config.configureWidget = ^(SentryUserFeedbackWidgetConfiguration *_Nonnull widget) {
if ([args containsObject:@"--io.sentry.feedback.auto-inject-widget"]) {
if ([args containsObject:@"--io.sentry.feedback.no-auto-inject-widget"]) {
widget.autoInject = NO;
} else {
widget.labelText = @"Report Jank";
widget.layoutUIOffset = layoutOffset;
} else {
widget.autoInject = NO;
}

if ([args containsObject:@"--io.sentry.feedback.no-widget-text"]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--io.sentry.feedback.auto-inject-widget"
isEnabled = "YES">
argument = "--io.sentry.feedback.no-auto-inject-widget"
isEnabled = "NO">
</CommandLineArgument>
</CommandLineArguments>
<EnvironmentVariables>
Expand Down
30 changes: 16 additions & 14 deletions Samples/iOS-Swift/iOS-Swift/SentrySDKWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,22 +128,24 @@ extension SentrySDKWrapper {
var layoutOffset: UIOffset { UIOffset(horizontal: 25, vertical: 75) }

func configureFeedbackWidget(config: SentryUserFeedbackWidgetConfiguration) {
if args.contains("--io.sentry.feedback.auto-inject-widget") {
if Locale.current.languageCode == "ar" { // arabic
config.labelText = ""
} else if Locale.current.languageCode == "ur" { // urdu
config.labelText = "نستعلیق"
} else if Locale.current.languageCode == "he" { // hebrew
config.labelText = "עִבְרִית‎"
} else if Locale.current.languageCode == "hi" { // Hindi
config.labelText = "नागरि"
} else {
config.labelText = "Report Jank"
}
config.layoutUIOffset = layoutOffset
} else {
guard !args.contains("--io.sentry.feedback.no-auto-inject-widget") else {
config.autoInject = false
return
}

if Locale.current.languageCode == "ar" { // arabic
config.labelText = ""
} else if Locale.current.languageCode == "ur" { // urdu
config.labelText = "نستعلیق"
} else if Locale.current.languageCode == "he" { // hebrew
config.labelText = "עִבְרִית‎"
} else if Locale.current.languageCode == "hi" { // Hindi
config.labelText = "नागरि"
} else {
config.labelText = "Report Jank"
}
config.layoutUIOffset = layoutOffset

if args.contains("--io.sentry.feedback.no-widget-text") {
config.labelText = nil
}
Expand Down

0 comments on commit ebf1c9c

Please sign in to comment.