当应用商店中有新版本可用时,通过代码检查和更新应用 [英] check and update an application through code when a new version is available in appstore

查看:64
本文介绍了当应用商店中有新版本可用时,通过代码检查和更新应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我想检查应用程序商店中是否有我的应用程序的任何更新版本.如果有,则必须通过警报消息通知用户,并且如果他/她选择升级,我想更新新版本.我想通过我的应用程序完成所有这些操作.这可能吗?

Within my application, I want to check if there is any updated version of my application is in the app store. If there is any, then have to inform the user through an alert message and if he/she opt for upgrade I want to update the new version.I want to do all this through my application. Is this possible?

推荐答案

您可以在服务器上存储最新的应用程序版本字符串.激活应用程序后,请从服务器请求此信息,并将其与应用程序Info.plist中包含的版本字符串进行比较.

You can store the most current application version string on your server. When the app is activated, request this information from the server and compare it to the version string that is contained in your applications Info.plist.

您可以像这样在Info.plist中获取版本

You can get the version in Info.plist like this

[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]

如果字符串不同,则可以显示警报,提示应用程序商店中有可用的较新版本.您还可以从警报直接链接到应用商店.

If the string differs, you can show an alert that a newer version is available in the app store. You can also link directly to the app store from the alert.

这篇关于当应用商店中有新版本可用时,通过代码检查和更新应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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