如何强制一个应用程序更新时,后端的变化需要更新的应用程序应用程序、后端

2023-09-07 23:20:33 作者:﹏习惯那些不曾习惯的习惯

我看过不同岗​​位有关强制一个应用程序的更新,以及PPL已(据我可以告诉)唯一的想法是创建一个应用程序调用,看看有什么版本的Web服务是当前的。在WS他们必须手动进行更新,以反映版本code。

I have read different posts about forcing an update of an app, and the only idea that ppl has had (as far as I can tell) is to create a web service which the app calls to see what version is the current one. The WS must them manually be updated to reflect the versionCode.

该方法有几个问题:

问题1:

当您上传一个应用程序来播放存储,那么它需要的若干小时的是供设备,下载之前,你永远不知道什么时候。另外,在我看来,像它可用在不同的时间为不同的设备,所以你真的不知道什么那么当它的适用于所有。

When you upload an app to the Play Store, then it takes several hours before it is available for devices to download, and you never know when. Also, it seems to me like it becomes available at different times for different devices, so you really have no clue what so ever when its "available for all".

这意味着,你不能马上起指导他们Play商店不会是非常有建设性的,因为更新的应用程序提供未启用反正有更新的WS(即告诉应用程序什么是当前的版本)。而且因为你不知道它什么时候会avaible,你真的不知道什么时候更新WS。

This means that you cannot immediately update the WS (that tells the app what is the "current" version) since directing them to Play Store won't be very constructive, as the updated app isnt available there anyways. And since you dont know when it will be avaible, you dont really know when to update the WS.

问题2:

有时候你做一些改变后端(通讯协议的更改或其他),需要你上传应用程序的新版本,然后更新后端,使他们可以互相交谈预期。在这种情况下,你真的想一些方法来告诉应用程序,请更新,因为你已经过时,并引导他们到Play商店。

Sometimes you do some changes to the back-end (comm protocol changes or something else) that requires you to upload the new version of the app and then update the backend so that they can talk to each other as expected. In this case, you really want some way to tell the app that "please update since you are out of date" and direct them to the Play Store.

所以,真正的问题是:

我怎样才能实现这个功能?

推荐答案

由于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.

据我所知,发布到谷歌播放可以有延迟,但只要在后台保留向后兼容,它不应该是一个问题。

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.