今天意外的发现了appstore居然还提供通过url获取json格式的客户端信息链接:
http://itunes.apple.com/lookup?id=$id
通过此地址可以获取应用的icon、介绍、截图、版本号以及版本说明
例如请求秘密的json信息:
Java代码
class="Apple-converted-space">
- http:
Java代码
- {
- "resultCount":1,
- "results": [
- {"kind":"software", "features":[],
- "supportedDevices":["iPodTouchFifthGen", "iPad2Wifi", "iPadFourthGen", "iPadFourthGen4G", "iPadMini4G", "iPadThirdGen", "iPadMini", "iPhone5", "iPhone5c", "iPad23G", "iPhone4", "iPhone4S", "iPadThirdGen4G", "iPhone5s"], "isGameCenterEnabled":false,
- "screenshotUrls":["http://a4.mzstatic.com/us/r30/Purple4/v4/3f/ee/08/3fee086d-cd99-2ac0-2159-99372c989ad3/screen1136x1136.jpeg", "http://a3.mzstatic.com/us/r30/Purple6/v4/07/a6/2d/07a62d2a-0bdc-ae5f-2239-532c364e9641/screen1136x1136.jpeg", "http://a2.mzstatic.com/us/r30/Purple4/v4/3f/e0/ca/3fe0ca8d-67bd-2923-d3c1-797dd362c0cb/screen1136x1136.jpeg", "http://a2.mzstatic.com/us/r30/Purple6/v4/4a/0d/9f/4a0d9f68-79fb-f0ca-d0c0-570da23ae037/screen1136x1136.jpeg", "http://a1.mzstatic.com/us/r30/Purple4/v4/04/7b/63/047b63d5-1f09-04fd-1c5c-3fabf45b33fc/screen1136x1136.jpeg"], "ipadScreenshotUrls":[], "artworkUrl60":"http://a1246.phobos.apple.com/us/r30/Purple/v4/c9/71/71/c97171eb-c2f9-4b13-378d-d5cfdde611b4/Icon.png", "artworkUrl512":"http://a1418.phobos.apple.com/us/r30/Purple/v4/33/d0/63/33d063f6-c2d1-a2fd-4490-d2ab86ac071b/mzl.cctcjnum.png", "artistViewUrl":"https://itunes.apple.com/us/artist/shenzhen-wumii-technology/id593518769?uo=4", "artistId":593518769, "artistName":"Shenzhen Wumii Technology Limited", "price":0.00, "version":"1.1",
- "description":"「秘密」是匿名版的朋友圈\n你可以和朋友们毫无顾忌地匿名分享秘密、八卦、爆料、真心话等等劲爆内容!\n\n「秘密」不是树洞,也不是漂流瓶\n你看到的秘密就来自你身边的朋友!\n同样,你发的秘密也会向你朋友展示,让最关心你的人的给你反馈!\n\n「秘密」让你带上面具,卸下身份\n发表和评论都是匿名的,就好像你和朋友都带上了面具,正在参加一个假面派对一样!卸下了身份,朋友们都可以畅所欲言!\n\n【主要功能】\n\n1.查看来自朋友的秘密\n2.匿名发表秘密和评论\n3.支持精美的图文排版\n4.极其严格的隐私保护\n\n\n【当朋友们都匿名了,他们会怎样?】\n\n在朋友圈:\n「还是宝马5系开着舒服,是时候和我那辆奥迪A4说拜拜了!」\n在秘密:\n「一早醒来我身上就背负着房贷车贷各种贷款,压力好大,活着真累!」\n\n在朋友圈:\n「能每天睁开眼睛跟老公说早安,这就是我最大的幸福!」\n在秘密:\n「3年前我走上了长江二桥,打算结束生命,但因他留下来了。他现在是我老公 。」\n\n更多朋友的秘密,等你发现\u2026\u2026\n\n\n官方微博:@秘密App", "currency":"USD", "genres":["Social Networking", "Lifestyle"], "genreIds":["6005", "6012"], "releaseDate":"2014-04-04T09:58:58Z", "sellerName":"Shenzhen Wumii Technology Limited", "bundleId":"com.wumii.ios.WMMimi", "trackId":839415177, "trackName":"秘密-朋友圈的匿名爆料", "primaryGenreName":"Social Networking", "primaryGenreId":6005, "releaseNotes":"- 新增重置密码功能\n- 新增评论显示楼层\n- 支持国际手机号注册登录\n- 提升应用稳定性", "formattedPrice":"Free", "wrapperType":"software", "trackCensoredName":"秘密-朋友圈的匿名爆料", "languageCodesISO2A":["EN", "ZH"], "fileSizeBytes":"15325961", "contentAdvisoryRating":"12+", "averageUserRatingForCurrentVersion":4.0, "userRatingCountForCurrentVersion":16, "artworkUrl100":"http://a1418.phobos.apple.com/us/r30/Purple/v4/33/d0/63/33d063f6-c2d1-a2fd-4490-d2ab86ac071b/mzl.cctcjnum.png", "trackViewUrl":"https://itunes.apple.com/us/app/mi-mi-peng-you-quan-ni-ming/id839415177?mt=8&uo=4", "trackContentRating":"12+", "averageUserRating":4.0, "userRatingCount":26}]
- }
回想之前做的ios版本检测都是客户端请求服务器,服务端返回最新版本信息以及跟新说明,并且服务端需要维护一个ios版本更新记录,实际上是把更新功能复杂化了;
后续ios版本更新可以采用:
1.后台只维护一个appstore的id
2.客户端每次检测升级直接请求appstore,获取appstore的版本信息,然后本地判断是否有新版本,有则提示更新