本篇文章是一篇关于应用更新的帖子

前目绝大多数的应用都可以实现应用更新后,打开应用能就失掉更新提示。这有利于用户的更新。

        关于如何实现的式方,很多人希望Xcode本身可以供提响应的API来实现对应用本版的查找,但就前目来看,还没有这样的API。因此,前目的解决办法有两种:
1、自己架设服务器,当应用更新后,就在自己的服务器中更新本版信息,然后让应用接连服务器来查找本版信息,与前当应用本版核查,如果更新则提示
2、用利App Store的Search-api,通过响应的api,request可以失掉响应的应用信息,关键是JSON式格的,因此就很方面临本版信息行进取提然后比对。上面是址网:
http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html
可以看到,只要用使https://itunes.apple.com/lookup?id=595176741 这样的url行进request,id要换成地点应用的id,然后就可以失掉JSON式格的信息。
上面是以应用 3D量角器为例可以失掉如下JSON信息:
{
 "resultCount":1,
 "results": [
{"kind":"software", "features":["iosUniversal"], "supportedDevices":["iPodTouchourthGen", "iPad2Wifi", "iPad23G", "iPhone4"], "isGameCenterEnabled":false, "artistViewUrl":"https://itunes.apple.com/us/artist/hongkun-song/id595176744?uo=4", "artworkUrl60":"http://a86.phobos.apple.com/us/r1000/091/Purple2/v4/0a/db/51/0adb5130-5d18-0b98-d1cc-3ddd114b10d5/icon57_57.png", 
"screenshotUrls":["http://a1960.phobos.apple.com/us/r1000/108/Purple/v4/ea/52/80/ea52802a-c7d9-1dca-defe-937fb61bbc3e/mzl.ghupvxyw.png", "http://a1740.phobos.apple.com/us/r1000/110/Purple2/v4/58/40/64/584064d8-1d3b-6704-3bf7-3b1c771d25c1/mzl.ydpovfzk.png", "http://a180.phobos.apple.com/us/r1000/100/Purple2/v4/22/01/90/22019008-314d-07e7-49e4-2359983058c0/mzl.hefjpqiw.png", "http://a1862.phobos.apple.com/us/r1000/107/Purple/v4/ee/23/a6/ee23a69f-768f-5fe8-9444-298a26330faa/mzl.sxiofdqt.png", "http://a980.phobos.apple.com/us/r1000/102/Purple/v4/cd/2c/9f/cd2c9fff-8dac-b75d-f260-c223ea8d2b33/mzl.trozlblw.png"], 
"ipadScreenshotUrls":["http://a651.phobos.apple.com/us/r1000/079/Purple/v4/e9/ab/55/e9ab55ab-6b7c-04ab-034e-833c113be412/mzl.ganeacuj.1024x1024-65.jpg", "http://a247.phobos.apple.com/us/r1000/107/Purple/v4/f3/87/60/f3876038-162a-7df4-87e5-54b6a5b14b78/mzl.vxycagic.1024x1024-65.jpg", "http://a831.phobos.apple.com/us/r1000/093/Purple2/v4/8b/b3/77/8bb37753-e3d5-9f45-ecfb-bf09cdb660f0/mzl.ncygstwb.1024x1024-65.jpg", "http://a376.phobos.apple.com/us/r1000/078/Purple/v4/f3/4e/36/f34e362f-dee0-0903-436e-034ba94a6f79/mzl.ecchwkyv.1024x1024-65.jpg", "http://a1624.phobos.apple.com/us/r1000/079/Purple/v4/db/12/9d/db129d6b-107b-fa80-f472-a8c7809ef513/mzl.xjmeijfn.1024x1024-65.jpg"], "artworkUrl512":"http://a1435.phobos.apple.com/us/r1000/076/Purple/v4/d1/36/f5/d136f5d0-3962-9ba1-95b2-3ca0ba3be9ec/mzl.zzqaoikx.jpg", "artistId":595176744, "artistName":"Hongkun Song", "price":1.99, "version":"2.0", 
每日一道理
只有启程,才会到达理想和目的地,只有拼搏,才会得获辉煌的成功,只有播种,才会有收获。只有追求,才会品味堂堂正正的人。
"description":"Measure actual angles from a distance? This magical App makes impossible happen!\n\nJust throw your plastic protractor away if you have an iPhone! I think you would never have to use traditional protractors any more! Since here is a much better tool for you to measure angles, that is your iOS device and of course, with the amazing app 3D Protractor!\n\n3D Protractor! A super tool for you to measure all kinds of angles in the 3D space by moving and rotating your iOS device or using the camera!\n\nDon\u2019t limit your imagination of measuring angles to just measuring the angle between two lines on a plane! This was an old thinking. 3D Protractor breaks it! In fact,it is so powerful that it can do following five jobs:\n1,Line-Line Angle Measurement. It can measure the angle of any two lines in the space,include the angle on a plane.\n2,Slope Angle Measurement. \n3,Dihedral Angle Measurement.\n4,Line-Face Angle Measurement.\n\n5,Camera Angle Measurement. It is a super cool feature! It can measure actual angles of any objects in front by the device's camera. Unbelievable! Actual angle! \n\nYou might feel a little bit confused at first after reading the above professional descriptions. This App uses 3D models to make it really easy for you to understand and use.\nEveryone can use it. Students can use it to do their homework. Teachers can use it to teach geometry especially solid geometry, which makes a really good teaching tool. Engineers can use it to measure any angles they need to know at work. And of course, there are many many more usages in our daily life.\n\n3D Protractor! Re-invention of protractor! \nA great app to make measuring angle easy and more accurate! \nA great app to change the world of angle measurement!\n\nPS. 1、If you measure an angle in a long time,the precision may be lower.\n2、This version has no Ads!", "currency":"USD", "genres":["Utilities", "Education"], "genreIds":["6002", "6017"], "releaseDate":"2013-01-26T07:54:39Z", "sellerName":"Hongkun Song", "bundleId":"com.manmanlai.-D-Protractor", "trackId":595176741, "trackName":"3D Protractor", "primaryGenreName":"Utilities", "primaryGenreId":6002, 
"releaseNotes":"1、Add Camera Angle Measurement Feature; \nIt is a super cool feature! It can measure actual angles of any objects in front by the device's camera. Unbelievable! Actual angle!\n2、Add radian number display; \nTap the number, then you would see the transition between degree and radian number. \n3、Add traditional chinese version; \n4、Fix some bugs;", "formattedPrice":"$1.99", "wrapperType":"software", "trackCensoredName":"3D Protractor", "trackViewUrl":"https://itunes.apple.com/us/app/3d-protractor/id595176741?mt=8&uo=4", "contentAdvisoryRating":"4+", "artworkUrl100":"http://a1435.phobos.apple.com/us/r1000/076/Purple/v4/d1/36/f5/d136f5d0-3962-9ba1-95b2-3ca0ba3be9ec/mzl.zzqaoikx.jpg", "languageCodesISO2A":["ZH", "EN"], "fileSizeBytes":"14633609", "averageUserRatingForCurrentVersion":5.0, "userRatingCountForCurrentVersion":2, "trackContentRating":"4+", "averageUserRating":4.5, "userRatingCount":8}]
}
 
可以看出,包含更新的内容都有,这就非常好办了。详细的实现式方这里写一下取获的方法:
 
[cpp]  
  
[plain]  
<span style="font-size:24px;">NSString *query = [NSString stringWithFormat:@"https://itunes.apple.com/lookup?id=%@", AppID];  
    query = [query stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];  
    NSData *jsonData = [[NSString stringWithContentsOfURL:[NSURL URLWithString:query] encoding:NSUTF8StringEncoding error:nil] dataUsingEncoding:NSUTF8StringEncoding];  
    NSError *error = nil;  
    NSDictionary *results = jsonData ? [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:&error] : nil;</span>  
取获了NSDictionary 的results,以后一切都好办。代码中地特入加UTF8String编码,用不也可以。当然,网页上说All JSON results are encoded as UTF-8。
 
另外,要得获App的本版号,如下
App本版: [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
App Build本版: [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];

文章结束给大家分享下程序员的一些笑话语录: 据说有一位软件工程师,一位硬件工程师和一位项目经理同坐车参加研讨会。不幸在从盘山公路下山时坏在半路上了。于是两位工程师和一位经理就如何修车的问题展开了讨论。
硬件工程师说:“我可以用随身携带的瑞士军刀把车坏的部分拆下来,找出原因,排除故障。”
项目经理说:“根据经营管理学,应该召开会议,根据问题现状写出需求报告,制订计划,编写日程安排,逐步逼近,alpha测试,beta1测试和beta2测试解决问题。”
软件工程说:“咱们还是应该把车推回山顶再开下来,看看问题是否重复发生。”

转载于:https://www.cnblogs.com/xinyuyuanm/archive/2013/05/06/3063487.html

应用更新iOS 开发:应用内实现 更新提醒相关推荐

  1. 苹果禁止使用热更新 iOS开发程序员新转机来临

    今天本是女神们的节日,所有iOS程序员沸腾了!原因是苹果爸爸发狠了,部分iOS开发者收到了苹果的这封警告邮件: [图一 苹果邮件] 消息一出,一时间众多开发者众说纷纭,以下是来源于网络的各种看法: 有 ...

  2. iOS开发网络资源整理-持续更新

    本文记录iOS开发相关的网络社区和博客 1.objc中国 网址:http://objccn.io 简介:onevcat创建,项目的成立源于国内 Objective-C 社区对 objc.io 的翻译活 ...

  3. iOS开发常用知识点(持续更新2018.6.25)

    iOS App打包上架超详细流程(手把手图文教你) https://www.jianshu.com/p/817686897ec1?open_source=weibo_search ios开发证书,描述 ...

  4. 玉炜的iOS开发规范(12.14更新)

    苹果账号篇 1.新建一个新项目之后的bundle ID无论是否定没定,上架的账号如果没定,最好先写一个绝对用不上的名字,因为这个bundle ID一经确定会被绑定在当前你的苹果账号上,如果正好绑定的是 ...

  5. 1、ios开发之 内购

    大家都知道做iOS开发本身的收入有三种来源:出售应用.内购和广告.国内用户通常很少直接购买应用,因此对于开发者而言(特别是个人开发者),内购和广告收入就成了主要的收入来源.内购营销模式,通常软件本身是 ...

  6. iOS开发中内置浏览器

    iOS开发中浏览网页通常有两种选择: 一是启动Mobile Safari的应用进行浏览,或是利用UIWebView进行内置显示. 但两种都有各种的不足,启动Safari应用会导致当前应用的中断或者退出 ...

  7. 【iOS开发】APP增量更新和热修复

    一.业务环境 公司提出我们的app每次更新不要全部下载, 只需要下载修改的部分. 二.实现方式 通过使用第三方平台,不用下载AppStore上的app,进而进行代码bug的修复. JSPatch Pl ...

  8. iOS开发之使用CocoaPods更新第三方出现“target overrides the `OTHER_LDFLAGS`……”问题解决方案

    今天在自己的项目中用CocoaPods引入第三方SDWebImage的时候,出现了问题.当更新完毕后,在终端没太注意这个问题的提示,就直接使用SDWebImage了,在使用的时候一些方法的提示和头文件 ...

  9. Win10设置系统补丁更新服务器,Win10 windows更新和安全选项内手动更新补丁升级方法图解...

    近日,微软推送了Win10新的KB3133431补丁,主要修复了此前不少用户遇到的Flash崩溃问题,建议用户立即更新升级修复.不过,不少Win10用户由于关闭了自动更新或者没有自动更新,所以,如果想 ...

最新文章

  1. 关于卡券系统设计--待续
  2. python 求均值_数据分析:寻找Python最优计算性能
  3. Web服务器安全设置
  4. Redis 基本操作
  5. socket python实例_Python网络编程—第27课—Socket实例(0531)
  6. 谷歌大脑提出DropBlock卷积正则化方法,显著改进CNN精度
  7. Tour West Australia by Motorcycle
  8. x86基础之数与数据类型
  9. 京条计划,今日头条不仅是京东的又一流量入口
  10. 小D课堂-SpringBoot 2.x微信支付在线教育网站项目实战_5-4.微信授权一键登录开发之授权URL获取...
  11. [OS X軟件] 我一直在用的 司机会看的那种 免费资源又多
  12. 萤石云视频PC客户端v2.6.14.0官方最新版
  13. 有哪些方式加速大数据查询速度
  14. mummer基因组共线性分析详解
  15. Android AdMob教程
  16. 大连民族大学计算机科学学院,魏巍 - 大连民族大学 - 计算机科学与工程学院
  17. 阿尔泰数据采集卡模拟量采集演示
  18. 实现微信打开网页时,获取当前微信用户信息(Java)(基于snsapi_userinfo方式)
  19. 微信SDK非ipad协议
  20. Cmn组合数c语言,计算并输出组合数Cmn……不会打……要求递归……谢谢

热门文章

  1. python读取excel画散点图-python学习之matplotlib绘制散点图实例
  2. python的none是什么-python中的null与none有什么区别
  3. python教程哪个版本好-终于清楚python入门最好的教程
  4. 零基础python从入门到精通 pdf-跟老齐学Python从入门到精通 电子版(pdf格式)
  5. python填写excel-Python向excel中写入数据的方法
  6. python 文件读写找不到文件-python之文件读写
  7. python数据分析的主要流程-将Python和R整合进一个数据分析流程
  8. python多线程爬虫实例-Python多线程爬虫简单示例
  9. zerodivisionerror什么意思python-Python with as的用法
  10. 小学生学python-小学生就学编程,就学Python,真的那么重要吗?