Move your Android integration to production

When you have finished integrating and testing the Connect SDK in development, work through this guide to move your integration to production.

Languages: Kotlin and Java

Availability: Pro, Premium, and Ultimate

Before you begin

Several sections below add settings to ConnectBasicConfig.properties. If you do not have this file yet, create it at exactly app/src/main/assets/ConnectBasicConfig.properties — the SDK looks up the file by that exact name and location. If the path or name does not match, the SDK silently falls back to its bundled defaults and your overrides have no effect.

For the full list of supported settings and their defaults, see the Connect Android SDK configuration reference.

Set up production credentials

Before you ship to production, ask your Connect administrator to create a dedicated Mobile app integration in Connect for the production build. Using distinct app keys for development and production keeps test sessions out of your production reports in Connect and gives you a per-environment kill switch — the kill switch URL embeds the app key, so separate keys mean you can disable Connect in production without affecting test.

Where your development Mobile app integration lives depends on whether your company has a separate Connect subscription for testing.

Both subsections below use BuildConfig fields for environment-specific credentials. If your team already manages config files per build type, you can alternatively store credentials in ConnectBasicConfig.properties and pass null to Connect.enable() — maintain separate copies of the file for each build type, using the same folder structure as google-services.json.

Select the option that matches your company's setup:

Both Mobile app integrations live in your production subscription. The collector URL is the same for both — only the app key differs.

Define a BuildConfig field for your development and production app keys in your app-level build.gradle.kts:

android {
    buildTypes {
        debug {
            buildConfigField("String", "APP_KEY", "\"YOUR_DEV_APP_KEY\"")
        }
        release {
            buildConfigField("String", "APP_KEY", "\"YOUR_PROD_APP_KEY\"")
        }
    }
}

Then reference it in the SDK initialization. The collector URL stays inline since it does not change between builds:

Connect.enable(
    appKey = BuildConfig.APP_KEY,
    postMessageUrl = "YOUR_COLLECTOR_URL"
)

Mask PII in session replay (Ultimate only)

Before releasing your app to production, mask the personally identifiable information (PII) that session replay would otherwise capture from your screens. See the guide for your architecture: View system or Compose.

Push notification settings

This section applies only to apps with push notifications enabled.

Firebase

During development you used a single Firebase project. For production, use a dedicated Firebase project to keep test data separate from live data and avoid sending test push notifications to production users.

  1. Create a production Firebase project in the Firebase console and download its google-services.json.
  2. Place each google-services.json in the corresponding build type folder so Gradle picks up the right file automatically:
app/
  src/
    debug/
      google-services.json    ← development Firebase project
    release/
      google-services.json    ← production Firebase project
  1. Generate a service account key for the production Firebase project and share it with your Connect administrator. Ask them to create a separate Mobile app integration in Connect for production. There is no environment setting in Connect — use the integration name or description to distinguish them (for example, "My App — Dev" and "My App — Prod").
  2. Update your app initialization to use the production app key provided by your Connect administrator.

Verify production push delivery

Before releasing to the Play Store, confirm the production push path end to end:

  1. Build and install a release build on a physical device.
  2. Grant notification permission when prompted.
  3. Verify that a push token is received via the onTokenReady callback.
  4. Coordinate with your marketing team to send a test push to your device.
  5. Verify the notification appears, images load, and push signals appear in the contact's activity feed in Connect.

Huawei

During development you used a single AppGallery Connect app. For production, use a dedicated app to keep test data separate from live data and avoid sending test push notifications to production users.

  1. Create a production app in AppGallery Connect and download its agconnect-services.json.
  2. Generate the SHA-256 fingerprint for your release signing certificate and register it in AppGallery Connect under General information > SHA-256 certificate fingerprint. Re-download agconnect-services.json after registering the fingerprint.
  3. Place each agconnect-services.json in the corresponding build type folder so Gradle picks up the right file automatically:
app/
  src/
    debug/
      agconnect-services.json    ← development AppGallery Connect app
    release/
      agconnect-services.json    ← production AppGallery Connect app
  1. Copy the HMS client ID, project ID, application ID, and client secret from the production agconnect-services.json and share them with your Connect administrator. Ask them to create a separate Mobile app integration in Connect for production.
  2. Update your app initialization to use the production app key provided by your Connect administrator.

Verify production push delivery

Before releasing to AppGallery, confirm the production push path end to end on a physical Huawei device:

  1. Build and install a release build on a physical Huawei device.
  2. Grant notification permission when prompted.
  3. Verify that a push token is received via the onTokenReady callback.
  4. Coordinate with your marketing team to send a test push to your device.
  5. Verify the notification appears, images load, and push signals appear in the contact's activity feed in Connect.

Configure the kill switch

The kill switch lets you remotely disable the Connect SDK on end users' devices without a new app release.

  1. Build your kill switch URL by taking your collector URL, replacing collectorPost with switch, and appending /{your_app_key}.

    For example, if your collector URL is https://lib-us-2.brilliantcollector.com/collector/collectorPost and your app key is 855e660c300000, your kill switch URL is https://lib-us-2.brilliantcollector.com/collector/switch/855e660c300000.

  2. In app/src/main/assets/ConnectBasicConfig.properties, set KillSwitchEnabled to true and add your kill switch URL:

    KillSwitchEnabled=true
    KillSwitchUrl=https://lib-us-2.brilliantcollector.com/collector/switch/YOUR_APP_KEY
📘

Note

The app will not initialize correctly until a valid kill switch URL is set, or KillSwitchEnabled is explicitly set to false.

Disable Logcat output

The Connect SDK ships with verbose Logcat output enabled by default. This is useful during integration but generates significant log volume in production. Before releasing your app, disable Logcat output by adding an override to your project.

  1. In your Android project, create app/src/main/assets/EOCoreBasicConfig.properties if it does not already exist.
  2. Add the following line:
DisplayLogging=false

With DisplayLogging=false, the SDK suppresses all Logcat output except ERROR-level messages. Errors continue to surface so you can troubleshoot SDK issues in production. Any settings you do not include in your EOCoreBasicConfig.properties file inherit the SDK's bundled defaults.

This setting controls Logcat output only. It does not affect what the SDK captures or posts to the Connect collector.

ProGuard rules

The Connect SDK ships with consumer ProGuard rules that Gradle applies automatically when you add it as a Maven dependency. No manual configuration is required.