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

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

问题描述

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

如果有一个严重的错误修复.在服务器中,我们正在设置新的发布版本.在启动画面中,我正在检查当前的应用程序版本,如果它低于服务版本,则会显示一条消息以更新应用程序.

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

我有两个问题

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

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

请帮我解答这两个问题

解决方案

Point 2 :如果您不希望用户稍后更新,您应该只允许强制更新作为一个选项.以编程方式关闭应用不是正确的选择.

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

在 Swift 中的使用:图书馆

func applicationDidBecomeActive(application: UIApplication) {/* 每天 (.daily) 或每周 (.weekly) 检查您的应用程序的新版本.如果用户在很长一段时间后从后台返回到您的应用程序,则很有用.放置在 applicationDidBecomeActive(_:)*/Siren.shared.checkVersion(checkType: .daily)}

Objective-C 中的使用:

-(void)applicationDidBecomeActive:(UIApplication *)application {//每天检查你的应用程序的新版本[[Harpy sharedInstance] checkVersionDaily];}

它是如何工作的:它使用查找 api 返回应用详细信息,如 link 包括版本并进行比较.

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

有关更多信息,请访问 链接

In my iOS app I have enabled force app update feature. It is like this.

If there is a critical bug fix. In the server we are setting the new release version. And in splash screen I am checking the current app version and if its lower than the service version, shows a message to update the app.

I have put 2 buttons "Update now", "Update later"

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天全站免登陆