强制用户在 Android 中拥有最新的应用程序版本

Force users to have last app version in Android

我看到的帖子很少,但大多数似乎都过时了。

我在 Play 商店发布了一个应用程序,它已经发布了版本代码 1 到 6。

我在这些版本中发现了一些严重的错误,我发布了版本代码为 7 的新版本。

新版本有一个应用内更新,以确保用户在下次更新到最新版本,但现在它不会对以前的版本产生任何影响,因为他们没有他们中的这段代码。有什么方法可以让版本代码 1 到 6 来下载最新版本吗?

只要用户继续使用版本 1 到 6,我就可以添加一些关键功能,我需要他们进行此更新。

此外,我使用 Firebase firestore/realtime database/fcm/storage/authentication。有什么办法可以从那里做到吗?唯一能想到的就是发云消息让用户更新应用。

谢谢

Is there a way I can make version codes 1 to 6 to download the latest version?

不,对不起。通过您建立的任何其他通信渠道(网站公告、博客 post、Twitter/Facebook/etc、电子邮件通讯等)让您的用户知道。

不幸的是,对于使用版本代码 1 到 6 的用户,您无能为力。我不知道你现有的“应用内更新”选项背后的逻辑是什么,但如果用户可以跳过这一步,你最终会遇到同样的问题。

为了解决这种情况,我们通常将应用程序的版本添加到数据库中,每次打开应用程序时,我们都会根据应用程序代码中的版本检查该值。如果匹配,则意味着不需要更新,否则,我们通过从 Google Play.

打开应用程序的页面来“强制”用户将应用程序更新到最新版本。

另一个解决方案也可能是 Android In-app updates:

When your users keep your app up to date on their devices, they can try new features, as well as benefit from performance improvements and bug fixes. Although some users enable background updates when their device is connected to an unmetered connection, other users might need to be reminded to install updates. In-app updates is a Play Core library feature that prompts active users to update your app.