8

I am planning to release my app to beta track before the prod. But I would like to enable in-app-bug reporting only for the beta users. Instead of creating two APKs(enabled in prod beta & disabled in prod), can I know programmatically from which track user has installed the app, is there any API available for that?

what I want to achieve is,

if(app installed from beta track)
  enable in-app-bug reporting
else 
  disable in-app-bug reporting
Ponsuyambu
  • 7,876
  • 5
  • 27
  • 41

2 Answers2

1

According to the documentation:

The release name is only for use in Play Console and won't be visible to users.

Christian Z.
  • 361
  • 4
  • 6
-3
buildTypes {

    debug {
        buildConfigField "Boolean", "in_app_bug", true
    }

    staging {
        buildConfigField "Boolean", "in_app_bug", true
    }

    release {
        buildConfigField "Boolean", "in_app_bug", false
    }
}

then in the code:

if(BuildConfig.in_app_bug) {
  ....
}

The same can be done for buildFlavors

Lena Bru
  • 13,521
  • 11
  • 61
  • 126
  • I think what christian-z meant, was in the same binary how could you detect what release track the app was downloaded from. – Grant Isom Oct 07 '22 at 21:17