简体   繁体   中英

How to detect the current release track inside the android app?(Google Play Console)

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

According to the documentation :

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM