Skip to content
Open
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: 1 addition & 6 deletions 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.8.0"
id "io.sentry.android.gradle" version "5.9.0"
id 'com.android.application'
id 'kotlin-android'
id 'com.ydq.android.gradle.native-aar.import'
Expand Down Expand Up @@ -82,7 +82,6 @@ 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 @@ -155,8 +154,4 @@ sentry {
minLevel = LogcatLevel.VERBOSE
}
}
// TODO remove this line when new version of the plugin is out
autoInstallation {
sentryVersion = "8.17.0"
}
}
39 changes: 1 addition & 38 deletions app/src/main/java/com/example/vu/android/MyApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,52 +171,15 @@ public void onCreate() {
}

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);
editTextName1.setHint("OMG! What happened??");

LinearLayout layoutName = new LinearLayout(this);
layoutName.setOrientation(LinearLayout.VERTICAL);
layoutName.setPadding(60, 20, 60, 20);
layoutName.addView(editTextName1);
alertDialogBuilder.setView(layoutName);

alertDialogBuilder.setTitle("Ooops, Checkout Failed!");
alertDialogBuilder.setPositiveButton("Submit", new DialogInterface.OnClickListener(){
@Override
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

Feedback feedback = new Feedback(txt);
feedback.setAssociatedEventId(sentryId);
feedback.setContactEmail("[email protected]");
feedback.setName("John Doe");
Sentry.captureFeedback(feedback);

}
});

alertDialogBuilder.setNegativeButton("Cancel",new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
options.setUseSentryUser(true);
});

AlertDialog alertDialog = alertDialogBuilder.create();
alertDialog.show();
}

}
Loading