Collect feedback from testers

This guide describes how to enable in-app feedback using the optional Firebase App Distribution Android SDK, so that your testers can submit feedback (including screenshots) directly in the app.

Before you begin

If you haven't already, add Firebase to your Android project.

Step 1: Enable the App Distribution Tester API

  1. Open the Google Cloud console and select your Firebase project.

  2. Under the Firebase App Testers API, click Enable.

Step 2: Add App Distribution to your app

The App Distribution Android SDK consists of two libraries:

  • firebase-appdistribution-api: The API-only library, which you can include in all build variants.
  • firebase-appdistribution: The full SDK implementation (optional).

The API-only library lets your code make calls to the SDK. The calls have no effect if the full SDK implementation is not present.

  1. Declare the dependency for the App Distribution Android SDK in your module (app-level) Gradle file (usually <project>/<app-module>/build.gradle.kts or <project>/<app-module>/build.gradle).

  2. To avoid including the full SDK implementation's self-update functionality in your Google Play builds, identify the build variants, including build types or product flavors that you will distribute through App Distribution.

  3. Declare the dependency for the App Distribution Android SDK in your module (app-level) Gradle file (usually app/build.gradle). Only add the full SDK implementation to variants that are intended exclusively for pre-release testing:

    Kotlin+KTX

    dependencies {
        // ADD the API-only library to all variants
        implementation("com.google.firebase:firebase-appdistribution-api-ktx:16.0.0-beta14")
    
        // ADD the full SDK implementation to the "beta" variant only (example)
        betaImplementation("com.google.firebase:firebase-appdistribution:16.0.0-beta14")
    }
    

    Java

    dependencies {
        // ADD the API-only library to all variants
        implementation("com.google.firebase:firebase-appdistribution-api:16.0.0-beta14")
    
        // ADD the full SDK implementation to the "beta" variant only (example)
        betaImplementation("com.google.firebase:firebase-appdistribution:16.0.0-beta14")
    }
    

Step 3: Configure in-app feedback

To collect feedback from your testers, use one of the following triggers to enable testers to initiate feedback:

  • Built-in notification trigger: The App Distribution Android SDK can display an ongoing notification that the tester can tap from anywhere in the app. Use this trigger if you want to get started more quickly and you don't need to customize how your testers provide feedback.

  • Custom trigger: You can provide your own trigger mechanism, like tapping a button or menu item in your app or shaking the device.

When you use either of these triggers and the tester submits feedback, the Android SDK performs the following actions:

  1. Captures a screenshot of the app's current activity.

  2. Runs checks to ensure the tester enabled the SDK's testing features. If the testing features are not enabled, the Android SDK prompts the tester to sign in to App Distribution with their Google account.

  3. Starts a full-screen activity that lets the tester write and submit their feedback.

Option 1: Notification trigger

Use showFeedbackNotification() to display a persistent or ongoing notification on the tester's device that they can tap to initiate feedback. When you configure the notification, you need to provide some text that will be displayed to the tester before they submit feedback, and a level of interruption for the notification (corresponding to the notification channel's importance). If you want to provide notice to your testers about the collection and processing of their feedback data, you can use the text to provide such a notice.

When you use showFeedbackNotification() and when the app goes to the background, the notification is hidden. If you want to explicitly hide the notification, use cancelFeedbackNotification(). We recommend that you put showFeedbackNotification() in your main activity's onCreate().

Kotlin+KTX

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        Firebase.appDistribution.showFeedbackNotification(
            // Text providing notice to your testers about collection and
            // processing of their feedback data
            R.string.additionalFormText,
            // The level of interruption for the notification
            InterruptionLevel.HIGH)
    }
}

Java

public class MainActivity extends AppCompatActivity {
    FirebaseAppDistribution firebaseAppDistribution =
        FirebaseAppDistribution.getInstance();
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        firebaseAppDistribution.showFeedbackNotification(
            // Text providing notice to your testers about collection and
            // processing of their feedback data
            R.string.additionalFormText,
            // The level of interruption for the notification
            InterruptionLevel.HIGH);
    }
}

Option 2: Custom trigger

Use the startFeedback() method to initiate feedback using a mechanism of your choice. For example, to trigger feedback you might want to add a "Send feedback" menu item to your app's action menu, or let your testers shake their device or take a screenshot. When you trigger feedback, provide some text that will be shown to the tester before they submit feedback. If you want to provide a notice to your testers about collection and processing of their feedback data, you can use this text to provide such a notice.

Kotlin+KTX

Firebase.appDistribution.startFeedback(R.string.feedbackMessage)

Java

FirebaseAppDistribution.getInstance().startFeedback(R.string.feedbackMessage);

Step 4: Build and test your implementation

Local testing

To test your implementation without having to distribute the app first, follow these steps:

  1. Enable dev mode on your local device:

    adb shell setprop debug.firebase.appdistro.devmode true
    
  2. Build your app as a pre-release variant that includes the full App Distribution libraries, and test that you can trigger feedback using the mechanism implemented in Step 3: Configure in-app feedback. Feedback is not submitted when in dev mode.

  3. After testing, you can disable dev mode on your device:

    adb shell setprop debug.firebase.appdistro.devmode false
    

End-to-end testing

To test that your app can send feedback, build your app as a pre-release variant that includes the full App Distribution libraries, and test your implementation following these steps:

  1. Upload a new app release to App Distribution.

  2. Distribute the app release to an account you have permission to access.

  3. Download the app through App Distribution's web or Android tester app.

  4. Trigger feedback using the mechanism implemented in Step 3: Configure in-app feedback.

  5. Ensure you're signed in with the same account to which you distributed the app release, and submit feedback.

  6. View your feedback in the new release's card in the Firebase console.

To learn how to resolve common issues, like testers unable to start feedback in the app, see Enabling testing features with the SDK.

Step 5: Manage tester feedback

After you enable your testers to send feedback, you can use the following tools to review and act on that feedback:

View and delete feedback in the Firebase console

You can review and delete user feedback, including screenshots, by opening the Tester feedback tab under a specific release in the Firebase console. User feedback is organized by release so you can confirm the version to which the feedback applies.

After reviewing user feedback, you can delete that feedback by clicking the Delete feedback button. The deleted feedback is removed from your release.

Receive email alerts for new feedback

To proactively learn about new tester feedback, you can receive email alerts when a tester submits feedback. The email alert includes the written feedback your tester provided and a link to any screenshots they submitted.

To receive App Distribution email alerts via this default mechanism, you must have the firebase.projects.update permission. The following roles include this required permission by default: Firebase Admin or project Owner or Editor.

By default, every project member who has the required permissions to receive email alerts will receive an email when a new feedback report is submitted. Project members can individually opt out of these alerts.

To disable email alerts, see Receive Firebase alerts.

Send new feedback to third-party tools

You can also send App Distribution alerts to your team's preferred notification channel using Cloud Functions for Firebase. For example, you can write a function that captures an alert event for new in-app feedback and posts the alert information to a third-party service like Discord, Slack, or Jira.

To set up advanced alerting capabilities using Cloud Functions for Firebase, follow these steps:

  1. Set up Cloud Functions for Firebase, which includes the following tasks:

    1. Download Node.js and npm.

    2. Install and sign into the Firebase CLI.

    3. Initialize Cloud Functions for Firebase using the Firebase CLI.

  2. Write and deploy a function that captures an in-app feedback alert event from App Distribution and handles the event payload (for example, posts the alert information in a message on Discord).

To see an example function that shows you how to send new feedback to Jira, refer to this sample.

To learn about all of the alert events that you can capture, see the reference documentation for App Distribution alerts.