FirebaseAppDistribution

public 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 methods

abstract void

Hides the notification shown with showFeedbackNotification or showFeedbackNotification.

abstract @NonNull Task<AppDistributionRelease>

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

default static @NonNull FirebaseAppDistribution

Gets the singleton FirebaseAppDistribution instance.

abstract boolean

Returns true if the App Distribution tester is signed in.

abstract void
showFeedbackNotification(
    @NonNull CharSequence additionalFormText,
    @NonNull 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.

abstract void
showFeedbackNotification(
    @StringRes int additionalFormText,
    @NonNull 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.

abstract @NonNull Task<Void>

Signs in the App Distribution tester.

abstract void

Signs out the App Distribution tester.

abstract void
startFeedback(@NonNull CharSequence additionalFormText)

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

abstract void
startFeedback(@StringRes int additionalFormText)

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

abstract void
startFeedback(
    @NonNull CharSequence additionalFormText,
    @Nullable Uri screenshot
)

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

abstract void
startFeedback(@StringRes int additionalFormText, @Nullable Uri screenshot)

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

abstract @NonNull UpdateTask

Updates app to the AppDistributionRelease returned by checkForNewRelease.

abstract @NonNull UpdateTask

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

Public methods

cancelFeedbackNotification

abstract void cancelFeedbackNotification()

Hides the notification shown with showFeedbackNotification or showFeedbackNotification.

checkForNewRelease

abstract @NonNull Task<AppDistributionReleasecheckForNewRelease()

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

default static @NonNull FirebaseAppDistribution getInstance()

Gets the singleton FirebaseAppDistribution instance.

isTesterSignedIn

abstract boolean isTesterSignedIn()

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

abstract void showFeedbackNotification(
    @NonNull CharSequence additionalFormText,
    @NonNull 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.

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
@NonNull CharSequence additionalFormText

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.

@NonNull 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

abstract void showFeedbackNotification(
    @StringRes int additionalFormText,
    @NonNull 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.

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
@StringRes int additionalFormText

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.

@NonNull 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

abstract @NonNull Task<VoidsignInTester()

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

abstract void signOutTester()

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

abstract void startFeedback(@NonNull CharSequence additionalFormText)

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
@NonNull CharSequence additionalFormText

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

abstract void startFeedback(@StringRes int additionalFormText)

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
@StringRes int additionalFormText

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

abstract void startFeedback(
    @NonNull CharSequence additionalFormText,
    @Nullable Uri screenshot
)

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
@NonNull CharSequence additionalFormText

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.

@Nullable Uri screenshot

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

startFeedback

abstract void startFeedback(@StringRes int additionalFormText, @Nullable Uri screenshot)

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
@StringRes int additionalFormText

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.

@Nullable Uri screenshot

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

updateApp

abstract @NonNull UpdateTask updateApp()

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

abstract @NonNull UpdateTask updateIfNewReleaseAvailable()

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.