FirebaseAppDistribution

interface FirebaseAppDistribution


The Firebase App Distribution API provides methods to update the app to the most recent pre-release build.

If you don't include the com.google.firebase:firebase-appdistribution artifact in your build, then all methods will be stubs and the Tasks and UpdateTasks will fail with NOT_IMPLEMENTED.

By default, Firebase App Distribution is automatically initialized.

Call getInstance to get the singleton instance of FirebaseAppDistribution.

Summary

Public functions

Unit

Hides the notification shown with showFeedbackNotification or showFeedbackNotification.

Task<AppDistributionRelease!>

Returns an AppDistributionRelease if an update is available for the current signed in tester, or null otherwise.

java-static FirebaseAppDistribution

Gets the singleton FirebaseAppDistribution instance.

Boolean

Returns true if the App Distribution tester is signed in.

Unit
showFeedbackNotification(
    additionalFormText: CharSequence,
    interruptionLevel: InterruptionLevel
)

Displays a notification that, when tapped, will take a screenshot of the current activity, then start a new activity to collect and submit feedback from the tester along with the screenshot.

Unit
showFeedbackNotification(
    additionalFormText: @StringRes Int,
    interruptionLevel: InterruptionLevel
)

Displays a notification that, when tapped, will take a screenshot of the current activity, then start a new activity to collect and submit feedback from the tester along with the screenshot.

Task<Void!>

Signs in the App Distribution tester.

Unit

Signs out the App Distribution tester.

Unit
startFeedback(additionalFormText: CharSequence)

Takes a screenshot, and starts an activity to collect and submit feedback from the tester.

Unit
startFeedback(additionalFormText: @StringRes Int)

Takes a screenshot, and starts an activity to collect and submit feedback from the tester.

Unit
startFeedback(additionalFormText: CharSequence, screenshot: Uri?)

Starts an activity to collect and submit feedback from the tester, along with the given screenshot.

Unit
startFeedback(additionalFormText: @StringRes Int, screenshot: Uri?)

Starts an activity to collect and submit feedback from the tester, along with the given screenshot.

UpdateTask

Updates app to the AppDistributionRelease returned by checkForNewRelease.

UpdateTask

Updates the app to the newest release, if one is available.

Public functions

cancelFeedbackNotification

fun cancelFeedbackNotification(): Unit

Hides the notification shown with showFeedbackNotification or showFeedbackNotification.

checkForNewRelease

fun checkForNewRelease(): Task<AppDistributionRelease!>

Returns an AppDistributionRelease if an update is available for the current signed in tester, or null otherwise.

If you don't include the com.google.firebase:firebase-appdistribution artifact in your build, then this method returns a failed Task with NOT_IMPLEMENTED.

getInstance

java-static fun getInstance(): FirebaseAppDistribution

Gets the singleton FirebaseAppDistribution instance.

isTesterSignedIn

fun isTesterSignedIn(): Boolean

Returns true if the App Distribution tester is signed in.

If you don't include the com.google.firebase:firebase-appdistribution artifact in your build, then this method always returns false.

showFeedbackNotification

fun showFeedbackNotification(
    additionalFormText: CharSequence,
    interruptionLevel: InterruptionLevel
): Unit

Displays a notification that, when tapped, will take a screenshot of the current activity, then start a new activity to collect and submit feedback from the tester along with the screenshot.

On Android 13 and above, this method requires the runtime permission for sending notifications: POST_NOTIFICATIONS. If your app targets Android 13 (API level 33) or above, you should request the permission.

When the notification is tapped:

  1. If the app is open, takes a screenshot of the current activity.
  2. If the tester is not signed in, presents the tester with a Google Sign-in UI.
  3. Starts a full screen activity for the tester to compose and submit the feedback.
Parameters
additionalFormText: CharSequence

text that will be shown to the tester before they submit feedback. If you’re a customer who would like to provide notice to your testers about collection and processing of their feedback data, you can use this text to provide such notice.

interruptionLevel: InterruptionLevel

the level of interruption for the feedback notification. On platforms below Android 8, this corresponds to a notification channel importance and once set cannot be changed except by the tester.

showFeedbackNotification

fun showFeedbackNotification(
    additionalFormText: @StringRes Int,
    interruptionLevel: InterruptionLevel
): Unit

Displays a notification that, when tapped, will take a screenshot of the current activity, then start a new activity to collect and submit feedback from the tester along with the screenshot.

On Android 13 and above, this method requires the runtime permission for sending notifications: POST_NOTIFICATIONS. If your app targets Android 13 (API level 33) or above, you should request the permission.

When the notification is tapped:

  1. If the app is open, takes a screenshot of the current activity.
  2. If the tester is not signed in, presents the tester with a Google Sign-in UI.
  3. Starts a full screen activity for the tester to compose and submit the feedback.
Parameters
additionalFormText: @StringRes Int

string resource ID of text that will be shown to the tester before they submit feedback. If you’re a customer who would like to provide notice to your testers about collection and processing of their feedback data, you can use this text to provide such notice.

interruptionLevel: InterruptionLevel

the level of interruption for the feedback notification. On platforms below Android 8, this corresponds to a notification channel importance and once set cannot be changed except by the tester.

signInTester

fun signInTester(): Task<Void!>

Signs in the App Distribution tester. Presents the tester with a Google sign in UI.

If you don't include the com.google.firebase:firebase-appdistribution artifact in your build, then this method returns a failed Task with NOT_IMPLEMENTED.

signOutTester

fun signOutTester(): Unit

Signs out the App Distribution tester.

If you don't include the com.google.firebase:firebase-appdistribution artifact in your build, then this method is a no-op.

startFeedback

fun startFeedback(additionalFormText: CharSequence): Unit

Takes a screenshot, and starts an activity to collect and submit feedback from the tester.

Performs the following actions:

  1. Takes a screenshot of the current activity.
  2. If the tester is not signed in, presents the tester with a Google Sign-in UI.
  3. Starts a full screen activity for the tester to compose and submit the feedback.
Parameters
additionalFormText: CharSequence

text that will be shown to the tester before they submit feedback. If you’re a customer who would like to provide notice to your testers about collection and processing of their feedback data, you can use this text to provide such notice.

startFeedback

fun startFeedback(additionalFormText: @StringRes Int): Unit

Takes a screenshot, and starts an activity to collect and submit feedback from the tester.

Performs the following actions:

  1. Takes a screenshot of the current activity.
  2. If the tester is not signed in, presents the tester with a Google Sign-in UI.
  3. Starts a full screen activity for the tester to compose and submit the feedback.
Parameters
additionalFormText: @StringRes Int

string resource ID of text that will be shown to the tester before they submit feedback. If you’re a customer who would like to provide notice to your testers about collection and processing of their feedback data, you can use this text to provide such notice.

startFeedback

fun startFeedback(additionalFormText: CharSequence, screenshot: Uri?): Unit

Starts an activity to collect and submit feedback from the tester, along with the given screenshot.

Performs the following actions:

  1. If the tester is not signed in, presents the tester with a Google Sign-in UI.
  2. Starts a full screen activity for the tester to compose and submit the feedback.
Parameters
additionalFormText: CharSequence

text that will be shown to the tester before they submit feedback. If you’re a customer who would like to provide notice to your testers about collection and processing of their feedback data, you can use this text to provide such notice.

screenshot: Uri?

URI to a bitmap containing a screenshot that will be included with the report, or null to not include a screenshot

startFeedback

fun startFeedback(additionalFormText: @StringRes Int, screenshot: Uri?): Unit

Starts an activity to collect and submit feedback from the tester, along with the given screenshot.

Performs the following actions:

  1. If the tester is not signed in, presents the tester with a Google Sign-in UI.
  2. Starts a full screen activity for the tester to compose and submit the feedback.
Parameters
additionalFormText: @StringRes Int

string resource ID of text that will be shown to the tester before they submit feedback. If you’re a customer who would like to provide notice to your testers about collection and processing of their feedback data, you can use this text to provide such notice.

screenshot: Uri?

URI to a bitmap containing a screenshot that will be included with the report, or null to not include a screenshot

updateApp

fun updateApp(): UpdateTask

Updates app to the AppDistributionRelease returned by checkForNewRelease.

If the newest release is an APK, downloads the binary and starts an installation. If the newest release is an AAB, directs the tester to the Play app to complete the download and installation.

Fails the Task with UPDATE_NOT_AVAILABLE if no new release is cached from checkForNewRelease.

If you don't include the com.google.firebase:firebase-appdistribution artifact in your build, then this method returns a failed UpdateTask with NOT_IMPLEMENTED.

updateIfNewReleaseAvailable

fun updateIfNewReleaseAvailable(): UpdateTask

Updates the app to the newest release, if one is available.

Returns the release information or null if no update is found. Performs the following actions:

  1. If the tester is not signed in, presents the tester with a Google Sign-in UI.
  2. Checks if a newer release is available. If so, presents the tester with a confirmation dialog to begin the download.
  3. If the newest release is an APK, downloads the binary and starts an installation. If the newest release is an AAB, directs the tester to the Play app to complete the download and installation.

If you don't include the com.google.firebase:firebase-appdistribution artifact in your build, then this method returns a failed Task with NOT_IMPLEMENTED.