是否可以检测到 android 应用程序是测试版还是生产版? [英] Is it possible to detect that an android app is either a beta version or production version?

查看:19
本文介绍了是否可以检测到 android 应用程序是测试版还是生产版?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在 google play 商店中使用 beta 阶段.对于应用端强制更新功能,我们想要检测我们的应用是来自 beta 阶段还是 google play 商店的生产阶段.这在安卓应用中可行吗?

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 of the google play store. Is this possible in android apps?

推荐答案

目前无法检测应用是从 Play 商店的 Beta 版还是 Production Track 安装的.

It's currently not possible to detect if the app was installed from either the Beta or Production Track on the Play Store.

假设您的应用将连接到您拥有的 API - 您可以做的是让 API 确定该应用是 Beta 还是 Prod 应用.例如,将被视为 Prod 应用程序的应用程序版本号存储在 API 上,当应用程序连接到 API 时,它会将其版本号传递给 API,并且 API 会返回响应是否为 Prod(版本匹配一个它已存储)或 Beta 应用程序(它与它已存储的一个不匹配).

Assuming your app will be connecting to an API that you own - What you can do is let the API determine if the App is a Beta or Prod App. For example store the app version number(s) that are considered a Prod app on the API, when the app connects to the API it passes it's version number to the API and the API returns a response with whether it is Prod (The version matches one it has stored) or Beta App (it's does not match one it has stored).

这有两个限制:

  1. 您需要更新 API 上的移动应用版本号当应用准备好投入生产时.
  2. 移动应用将由其版本号而非版本号决定跟踪他们在 Play 商店中的表现.

如果您对这 2 个限制感到满意,那么您将只有 1 个 APK 并且可以确定您的应用是 Prod 还是 Beta.

If you're happy with these 2 limitations then you will only have 1 APK and a means to determine if your app is Prod or Beta.

这篇关于是否可以检测到 android 应用程序是测试版还是生产版?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆