简体   繁体   中英

Releasing updated mobile app version

I launched a mobile app last week, both for iOS and Android (it's build with ionic framework if this could make any difference). Actually, it was much more like a beta version. Now, there are people that have installed the app. Not that huge amount, but anyway. I have now developed a new version. Thing is that the app relies on a server. And the server has changed a lot of things. So the client app on the store is not really in sync with the server code. When I release this updated version of the app, chances are huge that those people that use the "old" app will get really unpredictable results.

Is there a standard way to face with this? I cannot inform users that the app is out of date but only rely on OS telling the user there is a new version available.

This is really a general programming issue that has nothing to do with any specific platform.

Version 1 of your app requires version 1 of your server API and then you need to update the server to version 2 of its API for version 2 of your app.

Upon release of version 2 of your app, your user base will be a mix of both version 1 and version 2 of your app.

This means that your server needs to be able to respond to both versions of its API. There are a few possible ways to support this.

  1. Have two completely different URLs for each version. Example: http://version1.server.com/ ... and http://version2.server.com/ ... Just use the proper URL in each app.
  2. Pass a version number as part of the URL. Example: http://server.com?ver=2&other=whatever . You could have your server assume version 1 if there is no ver parameter in the URL.

The key point is that version 1 of the app is out there. The server needs to keep supporting that version of its API for a while. The server needs a way to support both. So version 2 of the app can be fixed now, before it is released, to work with whatever changes are made on the server to support both its old API and the new API.

Perhaps a little late now, but with planning:

1) Have your server "store" the latest version number of the app (I use Firebase for this). When your app runs, have it check its version number against the version number stored on the server. Thus, if the app is out of date, you can immediately display a message informing the user to update. (perhaps even with a custom message also retrieved from the server, informing them of the relative importance of this particular update)

2) If feasible, you can ensure your server maintains working code for the older versions and the newer versions simultaneously. On your Analytics, once you see everybody is on the new version, you can remove the old supporting code.

As an app developer, this needs to be at the top of your mind ALL the time. This will happen, and quite frequently too.

What you should do is every request to your server, you should supply the app version. Your backend should then use this app version to interpret the parameters of your request and service the mobile app accordingly.

On Android, you can get your app version using the following:

String vName, vCode;
try {
    PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
    vName = pInfo.versionName;
    vCode = Integer.toString(pInfo.versionCode);
} catch (Exception) {
    Log.d("App","Error!");
}

如果您使用了push notification ,则可以使用它,也可以切断此应用程序的API服务以强制人们重新安装您的应用程序。

假设您的应用程序的旧版本尝试与服务器进行通信,则您可以在服务器上轻松检测到该问题,并告诉用户该应用程序需要更新(例如Whatsapp /其他消息传递客户端的方式)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM