|
14 | 14 |
|
15 | 15 | package com.google.firebase.appdistribution;
|
16 | 16 |
|
| 17 | +import android.net.Uri; |
17 | 18 | import androidx.annotation.NonNull;
|
| 19 | +import androidx.annotation.Nullable; |
| 20 | +import androidx.annotation.StringRes; |
18 | 21 | import com.google.android.gms.tasks.Task;
|
19 | 22 | import com.google.firebase.FirebaseApp;
|
20 | 23 | import com.google.firebase.appdistribution.internal.FirebaseAppDistributionProxy;
|
|
32 | 35 | * <p>Call {@link #getInstance()} to get the singleton instance of {@link FirebaseAppDistribution}.
|
33 | 36 | */
|
34 | 37 | public interface FirebaseAppDistribution {
|
| 38 | + |
35 | 39 | /**
|
36 | 40 | * Updates the app to the newest release, if one is available.
|
37 | 41 | *
|
@@ -109,6 +113,142 @@ public interface FirebaseAppDistribution {
|
109 | 113 | @NonNull
|
110 | 114 | UpdateTask updateApp();
|
111 | 115 |
|
| 116 | + /** |
| 117 | + * Takes a screenshot, and starts an activity to collect and submit feedback from the tester. |
| 118 | + * |
| 119 | + * <p>Performs the following actions: |
| 120 | + * |
| 121 | + * <ol> |
| 122 | + * <li>Takes a screenshot of the current activity |
| 123 | + * <li>If tester is not signed in, presents the tester with a Google Sign-in UI |
| 124 | + * <li>Starts a full screen activity for the tester to compose and submit the feedback |
| 125 | + * </ol> |
| 126 | + * |
| 127 | + * @param additionalFormText string resource ID of text that will be shown to the tester before |
| 128 | + * they submit feedback. If you’re a customer who would like to provide notice to your testers |
| 129 | + * about collection and processing of their feedback data, you can use this text to provide |
| 130 | + * such notice. |
| 131 | + */ |
| 132 | + void startFeedback(@StringRes int additionalFormText); |
| 133 | + |
| 134 | + /** |
| 135 | + * Takes a screenshot, and starts an activity to collect and submit feedback from the tester. |
| 136 | + * |
| 137 | + * <p>Performs the following actions: |
| 138 | + * |
| 139 | + * <ol> |
| 140 | + * <li>Takes a screenshot of the current activity |
| 141 | + * <li>If tester is not signed in, presents the tester with a Google Sign-in UI |
| 142 | + * <li>Starts a full screen activity for the tester to compose and submit the feedback |
| 143 | + * </ol> |
| 144 | + * |
| 145 | + * @param additionalFormText text that will be shown to the tester before they submit feedback. If |
| 146 | + * you’re a customer who would like to provide notice to your testers about collection and |
| 147 | + * processing of their feedback data, you can use this text to provide such notice. |
| 148 | + */ |
| 149 | + void startFeedback(@NonNull CharSequence additionalFormText); |
| 150 | + |
| 151 | + /** |
| 152 | + * Starts an activity to collect and submit feedback from the tester, along with the given |
| 153 | + * screenshot. |
| 154 | + * |
| 155 | + * <p>Performs the following actions: |
| 156 | + * |
| 157 | + * <ol> |
| 158 | + * <li>If tester is not signed in, presents the tester with a Google Sign-in UI |
| 159 | + * <li>Starts a full screen activity for the tester to compose and submit the feedback |
| 160 | + * </ol> |
| 161 | + * |
| 162 | + * @param additionalFormText string resource ID of text that will be shown to the tester before |
| 163 | + * they submit feedback. If you’re a customer who would like to provide notice to your testers |
| 164 | + * about collection and processing of their feedback data, you can use this text to provide |
| 165 | + * such notice. |
| 166 | + * @param screenshot URI to a bitmap containing a screenshot that will be included with the |
| 167 | + * report, or null to not include a screenshot |
| 168 | + */ |
| 169 | + void startFeedback(@StringRes int additionalFormText, @Nullable Uri screenshot); |
| 170 | + |
| 171 | + /** |
| 172 | + * Starts an activity to collect and submit feedback from the tester, along with the given |
| 173 | + * screenshot. |
| 174 | + * |
| 175 | + * <p>Performs the following actions: |
| 176 | + * |
| 177 | + * <ol> |
| 178 | + * <li>If tester is not signed in, presents the tester with a Google Sign-in UI |
| 179 | + * <li>Starts a full screen activity for the tester to compose and submit the feedback |
| 180 | + * </ol> |
| 181 | + * |
| 182 | + * @param additionalFormText text that will be shown to the tester before they submit feedback. If |
| 183 | + * you’re a customer who would like to provide notice to your testers about collection and |
| 184 | + * processing of their feedback data, you can use this text to provide such notice. |
| 185 | + * @param screenshot URI to a bitmap containing a screenshot that will be included with the |
| 186 | + * report, or null to not include a screenshot |
| 187 | + */ |
| 188 | + void startFeedback(@NonNull CharSequence additionalFormText, @Nullable Uri screenshot); |
| 189 | + |
| 190 | + /** |
| 191 | + * Displays a notification that, when tapped, will take a screenshot of the current activity, then |
| 192 | + * start a new activity to collect and submit feedback from the tester along with the screenshot. |
| 193 | + * |
| 194 | + * <p>On Android 13 and above, this method requires the <a |
| 195 | + * href="https://developer.android.com/develop/ui/views/notifications/notification-permission">runtime |
| 196 | + * permission for sending notifications</a>: {@code POST_NOTIFICATIONS}. If your app targets |
| 197 | + * Android 13 (API level 33) or above, you should <a |
| 198 | + * href="https://developer.android.com/training/permissions/requesting">request the |
| 199 | + * permission</a>. |
| 200 | + * |
| 201 | + * <p>When the notification is tapped: |
| 202 | + * |
| 203 | + * <ol> |
| 204 | + * <li>If the app is open, take a screenshot of the current activity |
| 205 | + * <li>If tester is not signed in, presents the tester with a Google Sign-in UI |
| 206 | + * <li>Starts a full screen activity for the tester to compose and submit the feedback |
| 207 | + * </ol> |
| 208 | + * |
| 209 | + * @param additionalFormText string resource ID of text that will be shown to the tester before |
| 210 | + * they submit feedback. If you’re a customer who would like to provide notice to your testers |
| 211 | + * about collection and processing of their feedback data, you can use this text to provide |
| 212 | + * such notice. |
| 213 | + * @param interruptionLevel the level of interruption for the feedback notification. On platforms |
| 214 | + * below Android 8, this corresponds to a notification channel importance and once set cannot |
| 215 | + * be changed except by the user. |
| 216 | + */ |
| 217 | + void showFeedbackNotification( |
| 218 | + @StringRes int additionalFormText, @NonNull InterruptionLevel interruptionLevel); |
| 219 | + |
| 220 | + /** |
| 221 | + * Displays a notification that, when tapped, will take a screenshot of the current activity, then |
| 222 | + * start a new activity to collect and submit feedback from the tester along with the screenshot. |
| 223 | + * |
| 224 | + * <p>On Android 13 and above, this method requires the <a |
| 225 | + * href="https://developer.android.com/develop/ui/views/notifications/notification-permission">runtime |
| 226 | + * permission for sending notifications</a>: {@code POST_NOTIFICATIONS}. If your app targets |
| 227 | + * Android 13 (API level 33) or above, you should <a |
| 228 | + * href="https://developer.android.com/training/permissions/requesting">request the |
| 229 | + * permission</a>. |
| 230 | + * |
| 231 | + * <p>When the notification is tapped: |
| 232 | + * |
| 233 | + * <ol> |
| 234 | + * <li>If the app is open, take a screenshot of the current activity |
| 235 | + * <li>If tester is not signed in, presents the tester with a Google Sign-in UI |
| 236 | + * <li>Starts a full screen activity for the tester to compose and submit the feedback |
| 237 | + * </ol> |
| 238 | + * |
| 239 | + * @param additionalFormText text that will be shown to the tester before they submit feedback. If |
| 240 | + * you’re a customer who would like to provide notice to your testers about collection and |
| 241 | + * processing of their feedback data, you can use this text to provide such notice. |
| 242 | + * @param interruptionLevel the level of interruption for the feedback notification. On platforms |
| 243 | + * below Android 8, this corresponds to a notification channel importance and once set cannot |
| 244 | + * be changed except by the user. |
| 245 | + */ |
| 246 | + void showFeedbackNotification( |
| 247 | + @NonNull CharSequence additionalFormText, @NonNull InterruptionLevel interruptionLevel); |
| 248 | + |
| 249 | + /** Hides the notification shown with {@link #showFeedbackNotification}. */ |
| 250 | + void cancelFeedbackNotification(); |
| 251 | + |
112 | 252 | /** Gets the singleton {@link FirebaseAppDistribution} instance. */
|
113 | 253 | @NonNull
|
114 | 254 | static FirebaseAppDistribution getInstance() {
|
|
0 commit comments