Skip to content

Commit 77b1722

Browse files
authored
Update cleanup (#186)
* updated Sentry Android Gradle Plugin version to upgrade Android SDK version updated necessary options Enabled logs Switched user feedback with new API * updated Sentry Android Gradle Plugin version to upgrade Android SDK version Cleaned TODO items now unnecessary due to update * fixed sdk version
1 parent 6d98989 commit 77b1722

File tree

2 files changed

+2
-44
lines changed

2 files changed

+2
-44
lines changed

app/build.gradle

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import io.sentry.android.gradle.instrumentation.logcat.LogcatLevel
22

33
plugins {
4-
id "io.sentry.android.gradle" version "5.8.0"
4+
id "io.sentry.android.gradle" version "5.9.0"
55
id 'com.android.application'
66
id 'kotlin-android'
77
id 'com.ydq.android.gradle.native-aar.import'
@@ -82,7 +82,6 @@ android {
8282
}
8383

8484
dependencies {
85-
implementation 'io.sentry:sentry-android:8.17.0' // TODO remove this line when new version of the plugin is out
8685
// 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
8786
implementation 'io.sentry:sentry-native-ndk:0.8.3'
8887
implementation 'androidx.appcompat:appcompat:1.3.0'
@@ -155,8 +154,4 @@ sentry {
155154
minLevel = LogcatLevel.VERBOSE
156155
}
157156
}
158-
// TODO remove this line when new version of the plugin is out
159-
autoInstallation {
160-
sentryVersion = "8.17.0"
161-
}
162157
}

app/src/main/java/com/example/vu/android/MyApplication.java

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -171,52 +171,15 @@ public void onCreate() {
171171
}
172172

173173
private void launchUserFeedback(SentryId sentryId) {
174-
/* TODO replace with Sentry.showUserFeedback() when new version of the plugin is out
175174
Sentry.showUserFeedbackDialog(sentryId, options -> {
176175
options.setFormTitle("Ooops, Checkout Failed!");
177176
options.setMessagePlaceholder("OMG! What happened??");
178177
options.setShowName(true);
179178
options.setShowEmail(true);
180179
options.setSubmitButtonLabel("Submit");
181180
options.setCancelButtonLabel("Cancel");
182-
options.setUseSentryUser(false);
183-
}*/
184-
185-
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(mCurrentActivity);
186-
final EditText editTextName1 = new EditText(MyApplication.this);
187-
editTextName1.setHint("OMG! What happened??");
188-
189-
LinearLayout layoutName = new LinearLayout(this);
190-
layoutName.setOrientation(LinearLayout.VERTICAL);
191-
layoutName.setPadding(60, 20, 60, 20);
192-
layoutName.addView(editTextName1);
193-
alertDialogBuilder.setView(layoutName);
194-
195-
alertDialogBuilder.setTitle("Ooops, Checkout Failed!");
196-
alertDialogBuilder.setPositiveButton("Submit", new DialogInterface.OnClickListener(){
197-
@Override
198-
public void onClick(DialogInterface arg0, int arg1) {
199-
Toast.makeText(mCurrentActivity,"Thank you!",Toast.LENGTH_LONG).show();
200-
String txt = editTextName1.getText().toString(); // variable to collect user input
201-
202-
Feedback feedback = new Feedback(txt);
203-
feedback.setAssociatedEventId(sentryId);
204-
feedback.setContactEmail("[email protected]");
205-
feedback.setName("John Doe");
206-
Sentry.captureFeedback(feedback);
207-
208-
}
209-
});
210-
211-
alertDialogBuilder.setNegativeButton("Cancel",new DialogInterface.OnClickListener() {
212-
@Override
213-
public void onClick(DialogInterface dialog, int which) {
214-
dialog.cancel();
215-
}
181+
options.setUseSentryUser(true);
216182
});
217-
218-
AlertDialog alertDialog = alertDialogBuilder.create();
219-
alertDialog.show();
220183
}
221184

222185
}

0 commit comments

Comments
 (0)