@@ -70,7 +70,6 @@ class MainActivity : AppCompatActivity() {
70
70
feedbackTriggerMenu = findViewById(R .id.feedbackTriggerMenu)
71
71
val items = listOf (
72
72
FeedbackTrigger .NONE .label,
73
- FeedbackTrigger .SDK_NOTIFICATION .label,
74
73
FeedbackTrigger .CUSTOM_NOTIFICATION .label,
75
74
FeedbackTrigger .SHAKE .label,
76
75
FeedbackTrigger .SCREENSHOT .label,
@@ -85,12 +84,6 @@ class MainActivity : AppCompatActivity() {
85
84
FeedbackTrigger .NONE .label -> {
86
85
disableAllFeedbackTriggers()
87
86
}
88
- FeedbackTrigger .SDK_NOTIFICATION .label -> {
89
- disableAllFeedbackTriggers()
90
- Log .i(TAG , " Enabling notification trigger (SDK)" )
91
- firebaseAppDistribution.showFeedbackNotification(
92
- R .string.feedbackInfoText, InterruptionLevel .HIGH )
93
- }
94
87
FeedbackTrigger .CUSTOM_NOTIFICATION .label -> {
95
88
disableAllFeedbackTriggers()
96
89
startActivity(Intent (this , CustomNotificationActivity ::class .java))
@@ -106,6 +99,9 @@ class MainActivity : AppCompatActivity() {
106
99
}
107
100
}
108
101
}
102
+
103
+ firebaseAppDistribution.showFeedbackNotification(
104
+ R .string.feedbackInfoText, InterruptionLevel .HIGH )
109
105
}
110
106
111
107
override fun onDestroy () {
@@ -115,13 +111,15 @@ class MainActivity : AppCompatActivity() {
115
111
116
112
private fun disableAllFeedbackTriggers () {
117
113
Log .i(TAG , " Disabling all feedback triggers" )
118
- firebaseAppDistribution.cancelFeedbackNotification()
119
114
ShakeDetectionFeedbackTrigger .disable(application)
120
115
}
121
116
122
117
override fun onCreateOptionsMenu (menu : Menu ): Boolean {
123
118
val inflater: MenuInflater = menuInflater
124
119
inflater.inflate(R .menu.action_menu, menu)
120
+ if (BuildConfig .FLAVOR == " beta" ) {
121
+ menu.findItem(R .id.startFeedbackMenuItem).isVisible = true
122
+ }
125
123
return true
126
124
}
127
125
@@ -261,10 +259,10 @@ class MainActivity : AppCompatActivity() {
261
259
262
260
private fun failureListener (exception : Exception ) {
263
261
val ex = exception as com.google.firebase.appdistribution.FirebaseAppDistributionException
264
- Log .d(" FirebaseAppDistribution " , " MAINACTIVITY:ERROR ERROR. CODE: " + exception .errorCode)
262
+ Log .d(" MainActivity " , " Task failed with an error ( ${ex .errorCode} ): ${ex.message} " )
265
263
AlertDialog .Builder (this )
266
- .setTitle(" Error updating to new release " )
267
- .setMessage(" ${ex.message} : ${ex.errorCode} " )
264
+ .setTitle(" Task failed " )
265
+ .setMessage(" ${ex.message} \n\n Code : ${ex.errorCode} " )
268
266
.setNeutralButton(" Okay" ) { dialog, _ -> dialog.dismiss() }
269
267
.show()
270
268
}
@@ -320,7 +318,6 @@ class MainActivity : AppCompatActivity() {
320
318
NONE (" None" ),
321
319
SHAKE (" Shake the device" ),
322
320
SCREENSHOT (" Take a screenshot" ),
323
- SDK_NOTIFICATION (" Tap a notification (SDK)" ),
324
321
CUSTOM_NOTIFICATION (" Tap a notification (custom)" )
325
322
}
326
323
}
0 commit comments