Skip to content

Commit 64cc2ae

Browse files
committed
WIP - Notification trigger API
1 parent 765f9c8 commit 64cc2ae

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

firebase-appdistribution-api/src/main/java/com/google/firebase/appdistribution/FirebaseAppDistribution.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414

1515
package com.google.firebase.appdistribution;
1616

17+
import android.app.NotificationChannel;
1718
import android.net.Uri;
1819
import androidx.annotation.NonNull;
1920
import androidx.annotation.Nullable;
21+
import androidx.core.app.NotificationCompat;
2022
import com.google.android.gms.tasks.Task;
2123
import com.google.firebase.FirebaseApp;
2224
import com.google.firebase.appdistribution.internal.FirebaseAppDistributionProxy;
@@ -179,6 +181,29 @@ public interface FirebaseAppDistribution {
179181
*/
180182
void startFeedback(@NonNull CharSequence infoText, @Nullable Uri screenshot);
181183

184+
/**
185+
* Displays a notification that, when tapped, will take a screenshot of the current activity, then
186+
* start a new activity to collect and submit feedback from the tester along with the screenshot.
187+
*
188+
* <p>When the notification is tapped:
189+
*
190+
* <ol>
191+
* <li>If the app is open, take a screenshot of the current activity
192+
* <li>If tester is not signed in, presents the tester with a Google Sign-in UI
193+
* <li>Starts a full screen activity for the tester to compose and submit the feedback
194+
* </ol>
195+
*
196+
* <p>On platforms O and above, the notification will be created in its own notification channel.
197+
*
198+
* @param infoTextResourceId string resource ID of text to display to the tester before collecting
199+
* feedback data (e.g. Terms and Conditions)
200+
* @param importance the amount the user should be interrupted by notifications from the feedback
201+
* notification channel. See {@link NotificationChannel#setImportance}. On platforms below O,
202+
* the importance will be translated into a comparable notification priority (see {@link
203+
* NotificationCompat.Builder#setPriority}).
204+
*/
205+
void showFeedbackNotification(@NonNull int infoTextResourceId, int importance);
206+
182207
/** Gets the singleton {@link FirebaseAppDistribution} instance. */
183208
@NonNull
184209
static FirebaseAppDistribution getInstance() {

0 commit comments

Comments
 (0)