We use beta staging in google play store. For app side force update functionality we want to detect if our app is either coming from the beta stage or the production stage o
With "beta" or "staging" in your app version name, you can get it with getPackageInfo() and check with a Regex or indexOf
getPackageInfo()
indexOf
context.packageManager.getPackageInfo(context.packageName, 0).versionName.indexOf("beta") >= 0