我们可以从应用商店获取应用程序的版本号为iPhone? [英] Can we Obtain Version Number of application from App Store for iPhone?

查看:363
本文介绍了我们可以从应用商店获取应用程序的版本号为iPhone?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

而不是使用一个Web服务来获取当前的应用程序版本号,它在我的code比较的弹出更新警报,有什么办法来获得应用程序商店/我的应用程序版本号直接-Tunes?

Instead of using a web-service to get current application version number and comparing it in my code for popping up update alert, Is there any way to obtain the application version number from App-Store / i-Tunes directly?

在所有的意见后,会纠正我,如果我错了。

After going through all the comments correct me if i am wrong.


  1. 我们不应该表现出本地通知(如警报)与用户有关新的更新可用性编程?

  1. We should not show a Local Notification(as alert) to User regarding availability of new update programatically?

我去,虽然HIG准则,但不能这样Fing头creteria。所以有点糊涂了决定。

I went though HIG Guidelines, but could not fing such creteria. So little confused in deciding.

推荐答案

这样的警报更新肯定会针对苹果的指导方针。对于iOS设备,应用程序警报由App Store应用与显示可用更新的数量徽章显示。没有任何一个开发者需要做的。

Alert updates like this will certainly be against Apple guidelines. For iOS devices, application alerts are displayed by the App store app with a badge displaying the number of updates available. There is nothing a developer needs to do.

如果你担心用户缺少您的应用程序更新,放心,iOS用户请关注应用程序商店的应用程序和放大器;知道所有的更新都通过它。

If you are worried about the user missing your app update, rest assured that iOS users keep an eye on the app-store app & know that all updates come through it.

不过,也有通过它可以在更新后弄清楚,这是你第一次运行,而无需与任何Web服务或iTunes / App Store的哈克的方式。

However, there are hacky ways by which you can figure out that this is your first run after an update without contacting any web service or iTunes/App store.

一个已知的对我黑客:

获取库目录路径 -

Fetch the library directory path-

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
NSString *libPath = ([paths count] > 0) ? [paths objectAtIndex:0] : nil;

LIBPATH会是这样的 - 在/ var /移动/应用/ 8CFB747F-9446-44CB-98B9-C6FF1CF7BF93 /库

libPath would be something like - /var/mobile/Applications/8CFB747F-9446-44CB-98B9-C6FF1CF7BF93/Library

在每次更新/ Library中的更改此随机字符串。您可以在节省NSUserDefaults的这个字符串,并与每一个推出的保存字符串比较的路径。如果发现字符串是不同的,这意味着,这是更新后的第一次运行。显示更新警告!然后更新保存字符串以新的。

This random string before /Library changes with every update. You can save this string in NSUserDefaults, and compare the path with the saved string on every launch. If the strings are found to be different, it implies that this is your first run after the update. Display the update alert! Then update the saved string with the new one.

HTH,

阿克沙伊

这篇关于我们可以从应用商店获取应用程序的版本号为iPhone?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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