You should have considered this before publishing your app. Right now it's too late for that version, but make sure before publishing your new one that you have control over things like force update or support push notifications to suggest that a new update is live.
您不能阻止用户使用以前的版本。但您可以构建一个API。 在该api中,您声明应用程序的最新版本,并在应用程序中与当前版本进行检查。如果最新版本>当前应用程序版本,那么用户使用的是先前版本,则可以显示一个对话框来更新应用程序(使用setCancelable(false)可以阻止使用应用程序)。
要么
您可以在Google Play中查看最新版本的最新版本,然后执行相同操作。
You should have considered this before publishing your app. Right now it's too late for that version, but make sure before publishing your new one that you have control over things like
force update
or supportpush notifications
to suggest that a new update is live.不过请记住,过时的旧版本是一种不良做法,并且会带来不良的用户体验,除非您在应用程序中进行了重大迁移,否则您绝对不应该这样做。
我会在您的数据库中设置一个节点,该节点告知应用程序该应用程序具有哪个Build版本。我会发布代码,但目前没有时间,但这是一个Scheme:
Firebase实时数据库: + App_Versions / Android / allowedversion = 25(您当前的应用版本)
在应用程序中,确保您的appVersion满足从数据库读取的资格。 如果符合条件:显示文本,否则:不显示文本。
对不起,文字版本的解释!