• iOS


    一、问题:自己做提示用户升级?

    由于苹果做了自动升级,所有只要在应用程序中出现从AppStore检查版本更新,或者出现任何有关升级的提醒都会被拒但是如果必须添加升级提示的话,可以配合后台通过添加API的方式来做,就是版本信息存储在服务器,应用只需要请求数据,拿到数据版本然后和当前的版本比较就可以了,由于是从服务器拿数据,所以在审核期间,让后台控制版本,不提示升级问题,审核通过之后,更改服务器版本到最新版就可以了

    跳转到appstore 如下:

                [[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"itms-apps://itunes.apple.com/cn/app/id1288515707"]];

    //拿服务器的版本与当前的比较
    // 获取当前版本
    -(NSString *)version
    {
        NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
        NSString *app_Version       = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
        return app_Version;
    }


    二、id1288515707 这个id 如何获取如下:

    登录苹果开发者账号 --> 登录账号--> 点击iTunes Connect --> go to iTunes Connect --> My App (我的App) --> 点击App Store 栏下的 APP 信息 --> 向下滑会看到 Apple ID 这个就是跳转到应用程序需要的id






    三、从AppStore检查版本更新,一定不要去做,上线提交的时候一定会被拒的

    NSString *url = [[NSString alloc] initWithFormat:@"http://itunes.apple.com/lookup?id=%@",id]; // id就是线上产品的ID
    
    NSURL *url = [NSURL URLWithString:path];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url
                                                               cachePolicy:NSURLRequestReloadIgnoringCacheData
                                                           timeoutInterval:10];
        [request setHTTPMethod:@"POST"];
        NSOperationQueue *queue = [NSOperationQueue new];
    
        [NSURLConnection sendAsynchronousRequest:request queue:queue completionHandler:^(NSURLResponse *response,NSData *data,NSError *error){
            receiveStatusDic=[[NSMutableDictionary alloc]init];
            if (data) {
                NSDictionary *receiveDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
                NSLog(@"receiveDic is %@",receiveDic); //字典receiveDic中就包含版本信息
            }
     信息入下 
    {  
        resultCount = 1;  
        receiveDic =     (  
                    {  
                artistId = 开发者 ID;  
                artistName = 开发者名称; 
                price = 0; 
                isGameCenterEnabled = 0;  
                kind = software;  
                languageCodesISO2A =             (  
                    EN  
                ); 
                trackCensoredName = 审查名称;  
                trackContentRating = 评级;  
                trackId = 应用程序 ID;  
                trackName = 应用程序名称";  
                trackViewUrl = 应用程序介绍网址;  
                userRatingCount = 用户评级;  
                userRatingCountForCurrentVersion = 1;  
                version = 版本号;  
                wrapperType = software; 
          }  
        );  
    }



  • 相关阅读:
    一个2013届毕业生(踏上IT行业)的迷茫(2)
    一个2013届毕业生(踏上IT行业)的迷茫(1)
    Java 开源博客——B3log Solo 0.6.5 正式版发布了!
    Java 开源博客——B3log Solo 0.6.5 正式版发布了!
    在CSDN博客中添加量子恒道统计功能的做法
    Struts2——(8)struts2中文件的上传
    Struts2——(7)拦截器组件
    让富文本编辑器支持复制doc中多张图片直接粘贴上传
    ASP net 上传整个文件夹
    js文件夹上传
  • 原文地址:https://www.cnblogs.com/junhuawang/p/9050657.html
Copyright © 2020-2023  润新知