强制用户拥有最新版本的应用程序 [英] Force user to have the latest version of an app

查看:95
本文介绍了强制用户拥有最新版本的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能检查Android应用程序的启动用户是否具有最新版本,并迫使他更新,如果他有没有?
或者至少checkt是否有新版本,并告诉他,当他下载并安装更新的应用程序才会重新工作?

Is it possible to check on startup of an Android app whether the user has the latest version of it and force him to update if he has not? Or at least checkt whether there is a new version and tell him, that the app only will work again when he downloads and installs the update?

背景是,我有需要与服务器进行通信的应用程序。当我在服务器和客户端之间的接口改变的东西我想,以确保客户端具有最新版本。

Background is that I have an app that needs to communicate with a server. When I change something in the interface between server and client I want to assure that the client has the latest version.

有没有做到这一点任何原生的方式?还是我必须要检查这个我自己?

Is there any native way to do this? Or do I have to check this on my own?

推荐答案

我不认为有做这个原生的方式 - 但它的编码不是自己应该太硬;你必须:

I don't think there is a native way to do this -- but coding it yourself shouldn't be too hard ; you'll have to :


  • 实施版本检查:对您的服务器发出请求,并让您的服务器返回的最后一个版本号

  • 然后,如果从服务器获得的版本号是更高的应用程序的之一,询问用户以更新

您甚至可以做到这一点在每个请求 - 只是包括在从服务器的每个响应的版本号。
结果的可能是用户恢复应用程序,而不是重新开始从第一活动它的情况下非常有用。

You could even do this at each request -- just include the version number in each response from the server.
Might be useful in case the user resumes the application, instead of re-starting it from your "first" activity.

这篇关于强制用户拥有最新版本的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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