Skip to content

Commit 27c4ada

Browse files
authored
Merge branch 'main' into markushi/fix/session-replay-jetpack-composes-masking
2 parents 81429a6 + 4152701 commit 27c4ada

File tree

23 files changed

+2112
-8
lines changed

23 files changed

+2112
-8
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@
66

77
- Fix Session Replay masking for newer versions of Jetpack Compose (1.8+) ([#4485](https://github.com/getsentry/sentry-java/pull/4485))
88

9+
### Features
10+
11+
- Add New User Feedback form ([#4384](https://github.com/getsentry/sentry-java/pull/4384))
12+
- We now introduce SentryUserFeedbackDialog, which extends AlertDialog, inheriting the show() and cancel() methods, among others.
13+
To use it, just instantiate it and call show() on the instance (Sentry must be previously initialized).
14+
For customization options, please check the [User Feedback documentation](https://docs.sentry.io/platforms/android/user-feedback/configuration/).
15+
```java
16+
import io.sentry.android.core.SentryUserFeedbackDialog;
17+
18+
new SentryUserFeedbackDialog.Builder(context).create().show();
19+
```
20+
```kotlin
21+
import io.sentry.android.core.SentryUserFeedbackDialog
22+
23+
SentryUserFeedbackDialog.Builder(context).create().show()
24+
```
25+
926
## 8.13.3
1027

1128
### Fixes

sentry-android-core/api/sentry-android-core.api

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,24 @@ public final class io/sentry/android/core/SentryPerformanceProvider {
385385
public fun shutdown ()V
386386
}
387387

388+
public final class io/sentry/android/core/SentryUserFeedbackDialog : android/app/AlertDialog {
389+
public fun setCancelable (Z)V
390+
public fun setOnDismissListener (Landroid/content/DialogInterface$OnDismissListener;)V
391+
public fun show ()V
392+
}
393+
394+
public class io/sentry/android/core/SentryUserFeedbackDialog$Builder {
395+
public fun <init> (Landroid/content/Context;)V
396+
public fun <init> (Landroid/content/Context;I)V
397+
public fun <init> (Landroid/content/Context;ILio/sentry/android/core/SentryUserFeedbackDialog$OptionsConfiguration;)V
398+
public fun <init> (Landroid/content/Context;Lio/sentry/android/core/SentryUserFeedbackDialog$OptionsConfiguration;)V
399+
public fun create ()Lio/sentry/android/core/SentryUserFeedbackDialog;
400+
}
401+
402+
public abstract interface class io/sentry/android/core/SentryUserFeedbackDialog$OptionsConfiguration {
403+
public abstract fun configure (Landroid/content/Context;Lio/sentry/SentryFeedbackOptions;)V
404+
}
405+
388406
public class io/sentry/android/core/SpanFrameMetricsCollector : io/sentry/IPerformanceContinuousCollector, io/sentry/android/core/internal/util/SentryFrameMetricsCollector$FrameMetricsCollectorListener {
389407
protected final field lock Lio/sentry/util/AutoClosableReentrantLock;
390408
public fun <init> (Lio/sentry/android/core/SentryAndroidOptions;Lio/sentry/android/core/internal/util/SentryFrameMetricsCollector;)V

sentry-android-core/src/main/java/io/sentry/android/core/ManifestMetadataReader.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import io.sentry.ILogger;
77
import io.sentry.InitPriority;
88
import io.sentry.ProfileLifecycle;
9+
import io.sentry.SentryFeedbackOptions;
910
import io.sentry.SentryIntegrationPackageStorage;
1011
import io.sentry.SentryLevel;
1112
import io.sentry.protocol.SdkVersion;
@@ -126,6 +127,18 @@ final class ManifestMetadataReader {
126127
static final String ENABLE_AUTO_TRACE_ID_GENERATION =
127128
"io.sentry.traces.enable-auto-id-generation";
128129

130+
static final String FEEDBACK_NAME_REQUIRED = "io.sentry.feedback.is-name-required";
131+
132+
static final String FEEDBACK_SHOW_NAME = "io.sentry.feedback.show-name";
133+
134+
static final String FEEDBACK_EMAIL_REQUIRED = "io.sentry.feedback.is-email-required";
135+
136+
static final String FEEDBACK_SHOW_EMAIL = "io.sentry.feedback.show-email";
137+
138+
static final String FEEDBACK_USE_SENTRY_USER = "io.sentry.feedback.use-sentry-user";
139+
140+
static final String FEEDBACK_SHOW_BRANDING = "io.sentry.feedback.show-branding";
141+
129142
/** ManifestMetadataReader ctor */
130143
private ManifestMetadataReader() {}
131144

@@ -477,6 +490,21 @@ static void applyMetadata(
477490
options
478491
.getLogs()
479492
.setEnabled(readBool(metadata, logger, ENABLE_LOGS, options.getLogs().isEnabled()));
493+
494+
final @NotNull SentryFeedbackOptions feedbackOptions = options.getFeedbackOptions();
495+
feedbackOptions.setNameRequired(
496+
readBool(metadata, logger, FEEDBACK_NAME_REQUIRED, feedbackOptions.isNameRequired()));
497+
feedbackOptions.setShowName(
498+
readBool(metadata, logger, FEEDBACK_SHOW_NAME, feedbackOptions.isShowName()));
499+
feedbackOptions.setEmailRequired(
500+
readBool(metadata, logger, FEEDBACK_EMAIL_REQUIRED, feedbackOptions.isEmailRequired()));
501+
feedbackOptions.setShowEmail(
502+
readBool(metadata, logger, FEEDBACK_SHOW_EMAIL, feedbackOptions.isShowEmail()));
503+
feedbackOptions.setUseSentryUser(
504+
readBool(
505+
metadata, logger, FEEDBACK_USE_SENTRY_USER, feedbackOptions.isUseSentryUser()));
506+
feedbackOptions.setShowBranding(
507+
readBool(metadata, logger, FEEDBACK_SHOW_BRANDING, feedbackOptions.isShowBranding()));
480508
}
481509
options
482510
.getLogger()

0 commit comments

Comments
 (0)