OGeek|极客世界-中国程序员成长平台

标题: android - 如何处理移动应用程序中过时的 api [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 19:54
标题: android - 如何处理移动应用程序中过时的 api

虚构的情况如下:我有一个已发布到商店大约一年的移动应用程序(适用于 iOS 和 Android)。我正在准备新版本的应用程序。后端的一些 api 已过时或弃用。

问题是应用程序的用户如果不更新应用程序到新版本,应用程序的运行会遇到问题,因为后端api已经被替换或删除。

问题是如何在成为问题之前处理这种情况? 对于不同版本的应用程序之间的过时功能,苹果或谷歌是否有任何指南?



Best Answer-推荐答案


@Dimitris,这里您需要对旧应用程序进行强制更新。这可以使用应用程序配置文件来完成。基本上,您将拥有一个应用配置文件,其中包含带有以下键的 JSON:

{
   "server":{
      "app-server1-base-url":"http://",
      "status":{
         "is-running":true,
         "message":"We are busy upgrading XYZ server with technology and features. We will be back soon. We apologize for the inconvenience and appreciate your patience. Thank you for using XYZ!"
      },
      "force-update":{
         "status":false,
         "message":"lease download the latest version of XYZ from App Store to continue using the app. Thank You!"
      }
   }
}

关于android - 如何处理移动应用程序中过时的 api,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49431265/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4