强制用户在iOS中以编程方式更新应用 [英] Force user to update the app programmatically in iOS

查看:111
本文介绍了强制用户在iOS中以编程方式更新应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的iOS应用中,我启用了强制应用更新功能.就是这样.

如果存在严重的错误修复.在服务器中,我们正在设置新的发行版本.在初始屏幕中,我正在检查当前应用程序版本,如果它低于服务版本,则会显示一条消息以更新应用程序.

我已经设置了2个按钮立即更新",稍后更新"

我有2个问题

  1. 如果我现在单击.应用程序应该使用UPDATE按钮在appstore中打开我的应用程序.目前,我使用链接" http://appstore.com/mycompanynamepvtltd " 这将打开我公司应用程序的列表,但是即使我的应用程序有新更新,它也具有打开"按钮,而不是更新"按钮.进入更新页面的网址是什么?

  2. 如果他单击稍后更新"按钮,可以以编程方式关闭该应用程序吗?这会导致拒绝我在应用商店中的应用吗?

请帮助我解决这两个问题

解决方案

要点2 :如果您不希望用户以后进行更新,则仅应将强制更新作为选项.以编程方式关闭该应用程序不是正确的选择.

要点1 :为此,您可以使用一个好的库.

在Swift中的用法: 图书馆

func applicationDidBecomeActive(application: UIApplication) {
    /* Perform daily (.daily) or weekly (.weekly) checks for new version of your app.
    Useful if user returns to your app from the background after extended period of time.
     Place in applicationDidBecomeActive(_:)*/

    Siren.shared.checkVersion(checkType: .daily)
}

在Objective-C中的用法:图书馆

-(void)applicationDidBecomeActive:(UIApplication *)application {
    // Perform daily check for new version of your app
    [[Harpy sharedInstance] checkVersionDaily];
}

工作原理:它使用了查找api,该API返回了包括版本的链接之类的应用程序详细信息,并对其进行了比较./p>

例如,通过调用 https://itunes,通过iTunes ID查找Yelp软件应用程序.apple.com/lookup?id = 284910350

有关更多信息,请访问

I have 2 questions

  1. If I click now. App should open my app in the appstore with the button UPDATE. Currently I use the link "http://appstore.com/mycompanynamepvtltd" This opens list of my company apps but it has the button OPEN, not the UPDATE even there is a new update for my app. whats the url to go for update page?

  2. If he click the button "Update Later" is it ok to close the app programmatically? Does this cause to reject my app in the appstore?

Please help me for these 2 questions

解决方案

Point 2 : You should only allow force update as an option if you don't want user to update later. Closing the app programmatically is not the right option.

Point 1 : You can use a good library available for this purpose.

Usage in Swift: Library

func applicationDidBecomeActive(application: UIApplication) {
    /* Perform daily (.daily) or weekly (.weekly) checks for new version of your app.
    Useful if user returns to your app from the background after extended period of time.
     Place in applicationDidBecomeActive(_:)*/

    Siren.shared.checkVersion(checkType: .daily)
}

Usage in Objective-C: Library

-(void)applicationDidBecomeActive:(UIApplication *)application {
    // Perform daily check for new version of your app
    [[Harpy sharedInstance] checkVersionDaily];
}

How it works : It used lookup api which returns app details like link including version and compares it.

For an example, look up Yelp Software application by iTunes ID by calling https://itunes.apple.com/lookup?id=284910350

For more info, please visit link

这篇关于强制用户在iOS中以编程方式更新应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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