zoukankan      html  css  js  c++  java
  • iOSApp版本更新

    iOS版本更新:调接口

    后台返回三种状态  1.强制更新  2.无需更新 3.用户选择是否更新

    - (void)requestToCheckVersion

    {

        ELifeNetRequestData *req = [[ELifeNetRequestData alloc] init];

        [req setString:MFAppVersionShort forKey:@"versionNo"];

        [req setString:@"iphone" forKey:@"osName"];

        

        [[ELifeNetAPIClient sharedClient] requestPostWithType:ELifeRequest_getVersion args: [req toDictionary]

        success:^(id responseObject) {

            int forceUpgrade = [[responseObject objectForKey:@"forceUpgrade"] intValue];

            self.updateUrl = [responseObject objectForKey:@"upgradeUrl"];

            

            if (forceUpgrade == 1) {

                //强制更新

                [[UIApplication sharedApplication] openURL:[NSURL URLWithString:self.updateUrl]];

                return ;

            }else if (forceUpgrade == 2){

                //无需更新

                return;

            }else if (forceUpgrade == 3){

                //用户选择是否更新 alert

                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"有新版本,现在去更新吗?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];

                alert.tag = 1012;

                [alert show];

            }

            

        } failure:^(NSError *error) {

            

        }];

    }

    1
  • 相关阅读:
    数学工具WZgrapher
    零线和地线的区别,示波器如何测量市电?
    使用直流稳压电源时的注意事项!
    中文全角和半角输入有什么区别?
    ThinkingRock:使用方法
    2014记首
    如何使用Excel绘制甘特图
    AStyle代码格式工具在source insight中的使用
    STM32F103系列命名规则
    上市公司行情查询站点
  • 原文地址:https://www.cnblogs.com/fantasy3588/p/4707453.html
Copyright © 2011-2022 走看看