企业版本升级

2015-10-16 21:02:56.099 KndCRMv2[4616:288769] ssss{

  "title" : "有新版本,请更新",

  "vf" : "0",

  "resCode" : "200",

  "newUrl" : "https://c.kingnode.com/pool/1416798083104/1442821465426.plist"

}

else if (buttonIndex ==1 )

        {

            upgradeApp(newUrl, DEFINE_UPDATA_URL);

        }

#define DEFINE_UPDATA_URL   [NSString stringWithFormat:@"https://%@",SERVER_HOST]

iOS代码

//版本升级

CG_INLINE void upgradeApp(NSString *absolutePath, NSString *preURL)

{

    if (absolutePath.length>0) {

        if (absolutePath && [absolutePath rangeOfString:@"http"].location == 0) {

            NSString *strUrl=[NSString stringWithFormat:@"itms-services://?action=download-manifest&url=%@",absolutePath];

            NSURL* url = [NSURL URLWithString:strUrl];

            [[UIApplication sharedApplication] openURL:url];

        }

        else

        {

            NSString *strUrl=[NSString stringWithFormat:@"itms-services://?action=download-manifest&url=%@%@",preURL,absolutePath];

            NSURL* url = [NSURL URLWithString:strUrl];

            [[UIApplication sharedApplication] openURL:url];

        }

    }

}

你可能感兴趣的:(企业版本升级)