当Android Play商店中有新版本的应用程序时,强制更新应用程序 [英] Force app to update when new version of app is available in android play store
问题描述
我在Playstore上有一个应用.知道我想要的是Playstore上有可用的新更新时,用户在尝试使用该应用程序时应弹出一个窗口来更新该应用程序.如果他不更新应用程序,则应关闭该应用程序.例如:我想强迫用户更新应用程序以继续使用.
I had an app on the playstore. Know what I want is when new update is available on playstore the user should get a popup to update the app when he try to use the app. And if he does not update the app it should close the app. Ex: I want to force the user to update the app to continue using.
推荐答案
据我所知,Google Play没有为此提供任何API,因此您必须手动进行检查.
As far as I know Google Play doesn't provide with any kind of API for this, so you would have to manually check.
但是我可以告诉您一种强制用户使用最新版本进行更新的方法.
But I can tell you a method to force user to update with the latest release.
-
一种方法是通过向用户发送推送通知,并在收到通知后将用户重定向到Playstore.
One way is by sending a push notification to the user, and when you receive the notification you redirect user to the playstore.
第二种方法较长,但这是一种适当的确定方法. 您在存储应用程序最新版本的服务器上进行Web服务. 每当您的应用运行时,
Second Method is longer but this is a proper sure method. You make a webservice on a server, which stores the latest version of the app. whenever your apps runs,
- 在
MainActivity
上,您向Web服务发布请求,并检查应用程序中的版本是否为最新版本 - 如果它不是最新版本,则在网络服务的响应上,您可以将用户重定向到Playstore
- on
MainActivity
you make a post a request to the webservice and check if the version in the app is latest or not - If it is not the latest version, on the response of the webservice you can redirect user to the playstore
这篇关于当Android Play商店中有新版本的应用程序时,强制更新应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!