zoukankan      html  css  js  c++  java
  • 企业级证书升级程序(转)

    IOS应用程序升级流程介绍:IOS手机端应用程序需要升级时,打开服务器端html文件(本文为ucab.html文件)-》点击在线安装-》打开plist文件(本文中为ucab.plist文件)-》plist文件中存储有应用程序升级包的地址。(本文为:http://192.168.1.126:8088/netcrm/ucab.ipa),这个地址是在打包时填写的Application URL值。通过升级包地址访问升级包,提示安装升级。

    分步介绍:

    一、准备工作

    1、打包用的企业级证书mobileprovision文件,证书制作在这里就不罗嗦了。

    2、应用升级所需要的服务器端html文件。

         应用升级所需要的服务器端html文件,新建一个html文件(本文中为ucab.html),代码如下:

    Html代码  收藏代码
    1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    2. <html xmlns="http://www.w3.org/1999/xhtml">  
    3. <head>  
    4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
    5. <title>企业通讯录</title>  
    6. <script type="text/javascript">  
    7.         function openurl(url){  
    8.             window.self.location=url;  
    9.         }  
    10.     </script>  
    11. </head>  
    12. <style type="text/css">  
    13. html,body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,  
    14. fieldset,legend,input,button,textarea,select,p,blockquote,th,td,span,frame,iframe {margin:0;padding:0;}  
    15.   
    16. .outbox{ margin:0; 100%; height:1260px;}  
    17. .box02 {  margin: auto auto; 524px; height:81px; text-align:center;}  
    18. .button{ margin: 80px auto 0 auto; 458px; height:107px;}  
    19. </style>  
    20. <body>  
    21. <div class="outbox" style="border:1px solid  #dadfe3;" >  
    22.   <div class="box02" style=" margin-top:300px; 650px; height:81px"><label>  
    23.     <font style="font-size: 50pt">企业通讯录</font></label></div>  
    24.   <div class="button" style=" 666px; height: 152px" >  
    25.     <p align="center"><a href="#" style=" margin-top:650px;" target="_blank"><label onclick="openurl('itms-services://?action=download-manifest&url=http://192.168.1.126:8088/netcrm/ucab.plist');">  
    26.     <font style="font-size: 40pt">iOS 4.0以上在线安装</font></label></a><font style="font-size: 40pt"> </font> </div>  
    27. </div>  
    28. </body>  
    29. </html>  

     核心代码:

    Html代码  收藏代码
    1. "openurl('itms-services://?action=download-manifest&url=http://192.168.1.126:8088/netcrm/ucab.plist');"  

     http://192.168.1.126:8088/netcrm/ucab.plist为打包生成的ucab.plist文件的Web访问路径。

    二、应用程序打包

    V1.0打包:

    1、编译后打包

    2、点击distribute

    3、选择Save for Enterprise or Ad-Hoc Deployment,点击下一步

    4、选择打包用的企业级证书,点击下一步 

    5、打包应用命名,保存路径选择。选中Save for Enterprise Distribution。

    填写Application URL值,Application URL值为打包好的应用ipa文件的web访问路径。

    填写Title值,Title值为应用名称。

    注意每次打升级包时,保存的ipa文件名称要与Application URL值中web访问路径指向的ipa文件名称一致。否则的话,升级的时候会找不到升级包。 

    填写完毕,点击Save保存。V1.0打包完毕。生成ucab.ipa,ucab.plist两个文件。

    目前我们已有如下文件:

    (1)、ucab.ipa

    (2)、ucab.plist

    (3)、ucab.html

    将三个文件放到服务器端Web应用程序的同一目录下(本文中放到了服务器端应用netcrm的根目录web下),如果需要放到不同的目录,修改相应的文件访问路径即可。

    至此在手机端浏览器中输入ucab.html的访问路径,本文为:http://192.168.1.126:8088/netcrm/ucab.html,即可访问安装该应用程序。效果图如下:



     

     

     

    V1.1 打包步骤与V1.0打包步骤一致,命名时为与1.0区别可做以下改动:


    打包好V1.1,V1.0两个版本后即可测试升级功能。

    iphone手机端获取本地应用程序版本代码如下:

    Cpp代码  收藏代码
    1. NSString *nsstrLocalVersion = [[NSBundle mainBundle]objectForInfoDictionaryKey:@"CFBundleVersion"];  

    将本地版本号与接口获取的服务器端保存的版本号进行比较,如需要升级则执行iphone手机端升级代码。
    iphone手机端升级代码如下:

    Cpp代码  收藏代码
    1. [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@<a href="http://192.168.1.126:8088/ucab.html">http://192.168.1.126:8088/ucab.html</a>]];  

    执行该代码,通过手机端浏览器打开http://192.168.1.126:8088/ucab.html地址,进行应用程序安装,即可用新版本的应用程序替换旧版本的应用程序,完成应用程序升级功能。效果图与在手机端浏览器中输入ucab.html的访问路径,安装应用程序的效果图一致。

  • 相关阅读:
    poj 3318 Matrix Multiplication 夜
    hdu 4331 Image Recognition 夜
    poj 3277 City Horizon 夜
    poj 3301 Texas Trip 夜
    poj 1151 Atlantis 夜
    poj 3286 How many 0's 夜
    poj 2454 Jersey Politics 夜
    poj 1465 Multiple 夜
    poj 1095 Trees Made to Order 夜
    Null和undefined的区别?
  • 原文地址:https://www.cnblogs.com/CafeWing/p/3210337.html
Copyright © 2011-2022 走看看