APP不通过AppStore下载,APP应用内完成升级(不需要重新上传、审核)---他人文章链接,自己留着

来源:互联网 发布:工商信息查询网大数据 编辑:程序博客网 时间:2024/05/01 00:13

---------------------------------1.不通过AppStore,安装应用到IOS设备原理(http://mobile.51cto.com/hot-439095.htm)------------------------------------------

文章内容

通过itms-services协议,可以通过safari浏览器直接在iOS设备上安装应用程序。利用这种方式,只要在内网布置一个服务器,测试人员只需要通过测试设备的safari浏览器访问特定的url既可以实现安装,然后测试了。(PS:越狱设备也可以)

itms- services协议需要一个plist配置文件。如果要实现上面图示的功能,需要的文件有:一个ipa文件,一个plist文件,一个html文件和一个图片文件。其中,最主要的,就是plist文件。通过shell脚本,我们可以让其自动为我们生成plist文件和html文件,并且在xcode工程中的ipa文件和程序图标文件复制一份,放到一起。

xcode自动打ipa包脚本》学习地址:http://webfrogs.me/2012/09/19/buildipa/

plist文件范例如下:

  1. <?xml version="1.0" encoding="UTF-8"?>   
  2. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">   
  3. <plist version="1.0">   
  4. <dict>   
  5.    <key>items</key>   
  6.    <array>   
  7.        <dict>   
  8.            <key>assets</key>   
  9.            <array>   
  10.                <dict>   
  11.                    <key>kind</key>   
  12.                    <string>software-package</string>   
  13.                    <key>url</key>   
  14.                    <string>ipa包的下载地址,如:http://www.tammy.com:450/static/ios/(targetname)_(version)_build(buildversion)_yyyyMMdd.ipa</string>   
  15.                </dict>   
  16.            </array>   
  17.            <key>metadata</key>   
  18.            <dict>   
  19.                <key>bundle-identifier</key>   
  20.                <string>应用程序中的<span style="font-family:FangSong_GB2312">bundle-identifier</span><span style="font-family:FangSong_GB2312"></string></span>   
  21.                <key>bundle-version</key>   
  22.                <string>版本号</string>   
  23.                <key>kind</key>   
  24.                <string>software</string>   
  25.                <key>subtitle</key>   
  26.                <string>子标题</string>   
  27.                <key>title</key>   
  28.                <string>软件名称</string>   
  29.            </dict>   
  30.        </dict>   
  31.    </array>   
  32. </dict>   
  33. </plist>   

html文件范例如下:

  1. <span style="font-size:12px"><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">   
  2. <html>   
  3. <head>   
  4.   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">   
  5.   <meta http-equiv="Content-Style-Type" content="text/css">   
  6.   <title>测试包安装</title>   
  7. </head>   
  8. <body>   
  9. <br>   
  10. <div style="position:absolute;left:200px" width=400><a href="../index.html">返回</a></div>   
  11.     <h1 align="center">开发版(TRUNK)</h1>   
  12.     <table align="center" border=1 width=400>   
  13.     <tr height=60>   
  14.         <th colspan=2><h2>标题</h2></th>   
  15.     </tr>   
  16.     <tr height=60 align="center">   
  17.         <td width=200><a href="itms-services://?action=download-manifest&url=</span><span style="font-size:10px"><span style="font-family:FangSong_GB2312">http://www.tammy.com:450/static/ios/****.plist</span><span style="font-family:FangSong_GB2312">"><h2>Install</h2></a></td></span></span><span style="font-size:12px">   
  18.         <td width=200><a href="</span><pre name="code" class="html" style="color:rgb(34,34,34); line-height:22px">http://www.tammy.com:450/static/ios/(targetname)_(version)_build(buildversion)_yyyyMMdd.ipa</pre>"><h2>Download</h2></a></td></tr>    </table><br></body></html> 

不通过App Store,直接安装应用程序的实现步骤:

1、设置签名

利用developer profile或者adhoc distribution profile签名app,注意,不能使用distribution profile方式签名;个人开发者证书只能在100个设备中实现无线安装。

2、生成arichive

菜单:product->archive,完成后可以在organizer中看到生成的arichive

3、生成ipa

选择刚刚生成的arichive,点击“Distribute...",弹出如下图界面,选择第二个,点“next”,设置相关参数,一定要勾选“save for enterprise distribution”application url,是生成的ipa在服务器的位置;title是安装过程中出现的标题;large image url smal image url是安装过程中出现的图标。点击保存,将生成两个文件:***.ipa***.plist

4、服务器部署

将生成的***.ipa***.plist文件部署到服务器,同时在服务器生成一个html文件,目的是点击后打开一个链接,这样ios设备就会执行指令自动安装app了。要打开的链接内容如下:

itms-services://?action=download-manifest&url=http://www.tammy.com:450/static/ios/****.plist


-------------------------------------------------------------------------------------2.APP应用内完成升级-----------------------------------------------------------------------------------------

文章内容


没研究过支付宝钱包ios版本,不过根据appleapp框架,实现这个功能并不麻烦,尤其在HTML5普及以后,只不过其升级的功能是受到很多限制的。

简单得说,iosapp所用到的存储路径主要有两块,一块是app安装存放的地方,一块是app数据存放使用的地方。

ios app
本身需要数字签名,所以任何改动都需要通过apple的审核,或者私有证书的校验。必须以apple规定的方式进行更新,这也是防盗版,防山寨应用的重要基础

但是另外一块数据存放的路径,也就是我们俗称的沙盒,这里面的发生任何数据及文件的变动,是不需要数字签名,也不需要通过apple的方式去进行发布。

如果将程序一部分的界面,通过html(包含HTML5)或者其他自行定义的脚本或者界面原语做成文件形式,放在程序的沙盒中,在app中提供一个入口去访问这一部分的功能,那么这一部分的功能就可以随时通过app自行更新就可以做到了。很多游戏的关卡下载更新,电子书的下载,靠的也是这种方式

显然,这样做的更新,其作用范围是受到限制的。如果采用HTML/.HTML5的方式,那么你那部分的应用就只能通过HTML./HTML5实现,native的部分是不能这样升级的。
如果你是通过自有的解释引擎来实现,那么你如果更新引擎本身的话,也必须依赖apple的更新机制。

理论上来说,可以开发一个app,提供一个脚本语言的解释器以及运行环境,那么这个app就可以成为一个开发平台,所有使用这种脚本语言所编写的程序,都无需apple的更新安装渠道,可以自行安装更新。HTML5正是这样的一种引擎,只不过它缺省已经被ios本身所支持了。


---------------------------------3.程序内APP下载不用跳转到AppStore------------------------------------------------

文章内容

提示:需要iOS6.0以上才可以


SKStoreProductViewController类是UIViewController的子类,如果你对view controller比较熟悉的话,那SKStoreProductViewController使用起来也非常简单了。当你希望向用户展示App Store中产品时,你需要:

1.实例化一个SKStoreProductViewController
2.设置它的delegate
3.sotre product视图控制器显示给消费者

 

剩下的就交给操作系统来处理了。需要记住一点的是SKStoreProductViewController只能以模态的方式显示。SKStoreProductViewControllerDelegate协议定义了一个单独的方法—productViewControllerDidFinish:,当消费者离开App Store时会调用这个方法一般是通过点击左上角画面中的取消按钮。通过给代理发送productViewControllerDidFinish:消息,操作系统就会把控制权返回到你的程序。当然你不能忘了只支持IOS6.0及其以上~~

步骤:

1.添加 storeKit.framework

2.头文件里加上  

[objc] view plaincopyprint?CODE_ico.png


  1. #import <StoreKit/StoreKit.h>  
  2.   
  3. @interface ViewController : UIViewController<SKStoreProductViewControllerDelegate>  


3.直接在m中实现


[objc] view plaincopyprint?CODE_ico.png


  1. - (IBAction)doAction:(UIButton *)sender {  
  2.       [self showAppInApp:@"xxxxxx"];//此处xxxxx需要替换为需要的appID  
  3. }  
  4. - (void)showAppInApp:(NSString *)_appId {  
  5.   Class isAllow = NSClassFromString(@"SKStoreProductViewController");  
  6.   if (isAllow != nil) {  
  7.     SKStoreProductViewController *sKStoreProductViewController = [[SKStoreProductViewController alloc] init];  
  8.     sKStoreProductViewController.delegate = self;  
  9.     [sKStoreProductViewController loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier: _appId}  
  10.                       completionBlock:^(BOOL result, NSError *error) {  
  11.                         if (result) {  
  12.                           [self presentViewController:_SKSVC  
  13.                                              animated:YES  
  14.                                            completion:nil];  
  15.                         }  
  16.                         else{  
  17.                           NSLog(@"%@",error);  
  18.                         }  
  19.                       }];  
  20.   }  
  21.   else{  
  22.     //低于iOS6没有这个类  
  23.     NSString *string = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/us/app/id%@?mt=8",_appId];  
  24.     [[UIApplication sharedApplication] openURL:[NSURL URLWithString:string]];  
  25.   }  
  26. }  
  27.   
  28.   
  29. #pragma mark - SKStoreProductViewControllerDelegate   
  30.   
  31. //对视图消失的处理  
  32. - (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController {  
  33.   
  34.   
  35.   [viewController dismissViewControllerAnimated:YES  
  36.                                      completion:nil];  
  37.   
  38.   
  39. }  


---------------------------------1.不通过AppStore,安装应用到IOS设备原理(http://mobile.51cto.com/hot-439095.htm)------------------------------------------
0 0
原创粉丝点击