且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

当后端更改需要更新的应用程序时如何强制更新应用程序

更新时间:2022-12-20 23:25:28

正如 zapl 所说,后端应该始终允许向后兼容.每当您的应用调用后端服务器时,应用应报告其版本号,并且后端应做出相应响应.

As zapl has commented, the backend should ALWAYS allow backward compatibility. Whenever your app makes a call to the backend server the app should report its version number and the backend should respond accordingly.

至于强制应用更新,您应该查看 GCM 以推送通知,然后将用户带到更新,尽管实际上这不会强制"用户更新.

As for forcing an app update, you should look at GCM to push a notification which will then take the user to the update although in reality this wouldn't actually 'force' the user to update.

无论哪种方式,只要后端和应用程序都相互报告它们的版本号(可能带有更新可用"的通知),那么您就可以这样设计 1).他们继续工作,2).用户将在需要时尽快更新.

Either way, as long as both the backend and app report their version numbers to each other (perhaps with a notification of 'update available') then you can design things so 1). they continue to work and 2). users will update ASAP when they need to.

我了解发布到 Google Play 可能会有所延迟,但只要后端保持向后兼容性,这应该不是问题.

I understand that publishing to Google Play can have delays but as long as the backend retains backward compatibility, it shouldn't be a problem.