Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import io.sentry.android.gradle.instrumentation.logcat.LogcatLevel

plugins {
id "io.sentry.android.gradle" version "5.5.0"
id "io.sentry.android.gradle" version "5.8.0"
id 'com.android.application'
id 'kotlin-android'
id 'com.ydq.android.gradle.native-aar.import'
Expand Down Expand Up @@ -82,6 +82,7 @@ android {
}

dependencies {
implementation 'io.sentry:sentry-android:8.17.0' // TODO remove this line when new version of the plugin is out
// This should be included by default in the Android SDK, but it seems to be a problem with v8+ of the SDK, so we have to manually add it
implementation 'io.sentry:sentry-native-ndk:0.8.3'
implementation 'androidx.appcompat:appcompat:1.3.0'
Expand Down Expand Up @@ -154,4 +155,8 @@ sentry {
minLevel = LogcatLevel.VERBOSE
}
}
// TODO remove this line when new version of the plugin is out
autoInstallation {
sentryVersion = "8.17.0"
}
}
25 changes: 18 additions & 7 deletions app/src/main/java/com/example/vu/android/MyApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import io.sentry.UserFeedback;
import io.sentry.android.core.SentryAndroid;
import io.sentry.SentryLevel;
import io.sentry.protocol.Feedback;
import io.sentry.protocol.SentryException;
import io.sentry.protocol.SentryId;
import io.sentry.protocol.User;
Expand Down Expand Up @@ -82,6 +83,7 @@ public void onCreate() {
options.setEnablePerformanceV2(true);
options.getSessionReplay().setOnErrorSampleRate(1.0);
options.getSessionReplay().setSessionSampleRate(1.0);
options.getLogs().setEnabled(true);

options.setBeforeSend((event, hint) -> {

Expand Down Expand Up @@ -169,7 +171,17 @@ public void onCreate() {
Sentry.setUser(user);
}

private void launchUserFeedback(SentryId sentryId){
private void launchUserFeedback(SentryId sentryId) {
/* TODO replace with Sentry.showUserFeedback() when new version of the plugin is out
Sentry.showUserFeedbackDialog(sentryId, options -> {
options.setFormTitle("Ooops, Checkout Failed!");
options.setMessagePlaceholder("OMG! What happened??");
options.setShowName(true);
options.setShowEmail(true);
options.setSubmitButtonLabel("Submit");
options.setCancelButtonLabel("Cancel");
options.setUseSentryUser(false);
}*/

AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(mCurrentActivity);
final EditText editTextName1 = new EditText(MyApplication.this);
Expand All @@ -188,11 +200,11 @@ public void onClick(DialogInterface arg0, int arg1) {
Toast.makeText(mCurrentActivity,"Thank you!",Toast.LENGTH_LONG).show();
String txt = editTextName1.getText().toString(); // variable to collect user input

UserFeedback userFeedback = new UserFeedback(sentryId);
userFeedback.setComments( txt );
userFeedback.setEmail("john.doe@example.com");
userFeedback.setName("John Doe");
Sentry.captureUserFeedback(userFeedback);
Feedback feedback = new Feedback(txt);
feedback.setAssociatedEventId(sentryId);
feedback.setContactEmail("john.doe@example.com");
feedback.setName("John Doe");
Sentry.captureFeedback(feedback);

}
});
Expand All @@ -208,5 +220,4 @@ public void onClick(DialogInterface dialog, int which) {
alertDialog.show();
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ public void checkout() {
checkoutTransaction.setOperation("http");
Sentry.configureScope(scope -> scope.setTransaction(checkoutTransaction));

Log.v("checkout", "showing dialog");
final ProgressDialog progressDialog = new ProgressDialog(getActivity());
progressDialog.setCancelable(false);
progressDialog.setMessage("Checking Out...");
Expand Down Expand Up @@ -354,7 +355,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO
boolean success = response.isSuccessful();
response.close();
if (!success) {
Log.d("checkout", "response failed");
Log.w("checkout", "response failed");
runOnUiThread(new Runnable() {
@Override
public void run() {
Expand Down
Loading