iOS开发,应用内直接跳转到Appstore评分

来源:互联网 发布:sql server查看主键 编辑:程序博客网 时间:2024/05/22 06:19
1.进入appstore中指定的应用
    App Store 上评论的链接地址是 itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id = appID
    所以可以用这段代码:
[html] view plaincopy
  1. -(void)goToAppStore  
  2. {      
  3.     NSString *str = [NSString stringWithFormat:  
  4.                      @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%d",appID]; //appID 解释如下  
  5.     [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];  
  6.       
  7. }  
 注意: appID为itunesconnect中的应用程序id,这个appID 是itunes connect 里面你提交app 时候自动生成的,是apple的唯一的ID。如图:


所以我们的方法可以改为
[html] view plaincopy
  1. -(void)goToAppStore  
  2. {      
  3.     NSString *str = [NSString stringWithFormat:  
  4.                      @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%d",547203890];  
  5.     [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];     
  6. }  
2.进入首页

NSString *str = [NSString stringWithFormat: 

                         @"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=%@",
                        appID ];  

        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];




获取版本号(升级更新):https://itunes.apple.com/lookup?id=948600146

results数组里的"version":"1.3.3"

iTunesPerview:"artistViewUrl":"https://itunes.apple.com/us/developer/midea-group-co.-ltd./id558457251?uo=4”

跳转APPStore里指定应用评分:"trackViewUrl":"https://itunes.apple.com/us/app/mei-ju/id948600146?mt=8&uo=4"

{ "resultCount":1, "results": [{"artistViewUrl":"https://itunes.apple.com/us/developer/midea-group-co.-ltd./id558457251?uo=4", "artworkUrl60":"http://is5.mzstatic.com/image/thumb/Purple7/v4/7e/e9/9d/7ee99d3e-5eaf-e09e-4230-1d557d042bc6/AppIcon57x57.png/0x0ss-85.jpg", "screenshotUrls":["http://a2.mzstatic.com/us/r30/Purple1/v4/60/f3/0d/60f30d2f-0465-89f8-09f6-3085728dd07e/screen1136x1136.jpeg", "http://a5.mzstatic.com/us/r30/Purple7/v4/37/9d/3d/379d3d68-bd5c-5a6b-f7aa-dc9638ef8c36/screen1136x1136.jpeg", "http://a5.mzstatic.com/us/r30/Purple7/v4/08/51/df/0851dfcf-3bf4-ec48-1c69-cca93db8325e/screen1136x1136.jpeg", "http://a2.mzstatic.com/us/r30/Purple1/v4/77/4a/70/774a7081-7485-1cba-1892-2aa3f78d5442/screen1136x1136.jpeg"], "artworkUrl512":"http://is5.mzstatic.com/image/thumb/Purple1/v4/14/ab/ef/14abefcf-de3c-2d05-25b0-a27d65e59612/mzl.okinzzlq.jpg/0x0ss-85.jpg", "ipadScreenshotUrls":[], "features":[], "supportedDevices":["iPhone6", "iPhone5c", "iPhone4S", "iPad2Wifi", "iPad23G", "iPadThirdGen", "iPadFourthGen4G", "iPodTouchFourthGen", "iPadThirdGen4G", "iPhone-3GS", "iPadMini4G", "iPhone4", "iPadMini", "iPhone5s", "iPhone5", "iPodTouchFifthGen", "iPodTouchSixthGen", "iPadFourthGen", "iPhone6Plus"], "kind":"software", "advisories":[], "isGameCenterEnabled":false, "trackCensoredName":"美居", "trackViewUrl":"https://itunes.apple.com/us/app/mei-ju/id948600146?mt=8&uo=4", "contentAdvisoryRating":"4+", "artworkUrl100":"http://is5.mzstatic.com/image/thumb/Purple1/v4/14/ab/ef/14abefcf-de3c-2d05-25b0-a27d65e59612/mzl.okinzzlq.jpg/0x0ss-85.jpg", "fileSizeBytes":"14256870", "trackContentRating":"4+", "languageCodesISO2A":["EN", "ZH"], "currency":"USD", "wrapperType":"software", "version":"1.3.3", "releaseDate":"2015-01-23T19:26:31Z", "sellerName":"Midea Group Co., Ltd.", "bundleId":"com.midea.msmart.appstore", "releaseNotes":"1. Bugs fix.", "artistId":558457251, "artistName":"Midea Group Co., Ltd.", "genres":["Lifestyle", "Utilities"], "price":0.00, "description":"美居是美的集团基于M-Smart系统推出的智能家电管理应用。通过美居,可以实现三大核心功能:1、家电管理:可将美的旗下全品类智能家电产品连接,各品类产品体验入口均一致,实现产品的智能管控一体化;2、远程体验:美居,不仅可在局域网范围内管理美的智能家电,还能在广域网情况下进行产品的远程管理体验;3、消息提醒:通过产品传感器的数据信息上报。", "genreIds":["6012", "6002"], "trackName":"美居", "trackId":948600146, "primaryGenreName":"Lifestyle", "primaryGenreId":6012, "isVppDeviceBasedLicensingEnabled":true, "minimumOsVersion":"6.0", "formattedPrice":"Free"}]}
0 0
原创粉丝点击