简体   繁体   English

可用新版本时更新ios应用

[英]To update ios app when newer version is available

I am totally new to ios development. 我对ios开发完全陌生。 I have an ios7 and ios8 app which do polling to Server to check for latest version. 我有一个ios7和ios8应用程序,它们会轮询服务器以检查最新版本。 Once the latest version of app is available I am opening Alert Box(Notification) for user to update App. 提供最新版本的应用程序后,我将打开警报框(通知)供用户更新应用程序。

  1. Now, once user click on Update Button, Which API I need to use to get latest version of App from Apple App Store or Web Store. 现在,一旦用户单击“更新按钮”,我需要使用哪个API从Apple App Store或Web Store获取最新版本的App。
  2. And how can I move the user's saved preferences to new App. 以及如何将用户保存的首选项移动到新的应用程序。

Will be helpful If some one can put code sample to do so. 如果有人可以放置代码示例会有所帮助。

I don't believe there's an API which you can call to update the app. 我不认为您可以调用API来更新应用程序。 The only option available is to send the user to the App Store page for your app where they will see the update button. 唯一可用的选项是将用户引导到您的应用程序的“应用程序商店”页面,他们将在其中看到更新按钮。

As far as preferences go if you're storing them in NSUserDefaults or as a plist then they should persist unless the user deletes the application from the device. 就首选项而言,如果您将它们存储在NSUserDefaults或作为plist存储,则它们应该保持NSUserDefaults ,除非用户从设备中删除了该应用程序。

I found the solution to my problem. 我找到了解决我问题的方法。

Every App has a unique url in the App Store. 每个应用程序在App Store中都有一个唯一的URL。

Lets assume you have updated your app from version 1.1 to 1.2 and releases app in app store. 假设您已将应用程序从版本1.1更新到1.2,并在应用商店中发布了该应用程序。

Now in the application after checking your app version you can use openURL method to redirect to the url of App in app Store 现在,在检查您的应用程序版本后,可以在应用程序中使用openURL方法重定向到应用程序商店中应用程序的URL

eg 例如

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"AppURL-String"]]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@“ AppURL-String”]]];

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用户强制更新可用的新版本应用程序 - How to make user forcefully update the newer version of the app available 当较新的 iOS 应用程序版本已经发布时,如何更新较旧的 iOS 应用程序版本? - How to update an older iOS app version when a newer one is already out? 如果App Store iOS中有可用的较新版本的应用程序,有任何适当的方法可以在应用程序内通知用户? - Any proper method to notify user within app if newer version of app available in App Store iOS? 新版本可用时 App Store 不显示更新按钮 - App Store not showing update button when new version is available 苹果是否允许为iOS应用程序强制更新到较新版本? - Does Apple allows force update to newer version for iOS Applications? iPhone 应用程序:先测试较新版本的应用程序,然后再提供给其他用户下载 - iPhone App:Test the newer version of app first and after make it available for other users for download 更新版本时如何更改iTunes Connect中的iOS应用程序图标? - How to change the iOS app icon in iTunes Connect when update the version? 如果我强制用户更新到appstore上可用的更新版本,AppStore是否会拒绝我的应用程序 - Will AppStore reject my application if i force user to update to newer version available on appstore iOS - 提示用户更新到最新的应用版本 - iOS - Prompt User to Update to Latest App Version 更新到新版本后,iOS中的应用程序崩溃了 - App in iOS crashed after update to new version
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM