苹果提供的更新以及后台接口绕过审核的更新

来源:互联网 发布:淘宝助理无法同步店铺 编辑:程序博客网 时间:2024/06/11 15:26

#if 0

    AFHTTPSessionManager *manage = [AFHTTPSessionManager manager];

    manage.requestSerializer = [AFHTTPRequestSerializer serializer];

    manage.responseSerializer = [AFHTTPResponseSerializer serializer];

    

    NSString *encodingUrl=[[@"http://itunes.apple.com/cn/lookup?id=" stringByAppendingString:@"584306477"] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

    

    [manage POST:encodingUrl parameters:nil progress:^(NSProgress *_Nonnull uploadProgress) {

        

    } success:^(NSURLSessionDataTask * _Nonnull task,id  _Nullable responseObject) {

        NSDictionary *resultDic=[NSJSONSerialization JSONObjectWithData:(NSData *)responseObject options:0 error:nil];

        //线上的版本

        NSString * versionStr =[[[resultDic objectForKey:@"results"] objectAtIndex:0] valueForKey:@"version"];

        

        NSDictionary *infoDic=[[NSBundle mainBundle] infoDictionary];

        //当前版本

        NSString * currentVersion = [infoDic valueForKey:@"CFBundleShortVersionString"];

        

        if([currentVersion compare:versionStr options:NSNumericSearch]==NSOrderedDescending){

            DLog(@"%@ is bigger",currentVersion);

        }elseif ([currentVersion compare:versionStr options:NSNumericSearch]==NSOrderedSame){

            // 当前版本和本地版本相同的 情况     就不去市场更新

            DLog(@"版本号相同");

        }else{

            DLog(@"%@ is bigger",versionStr);

            UIAlertView *alert = [[UIAlertView alloc]

                                  initWithTitle:@"检测到有新的版本"

                                  message:@" 1,增加分享功能。\n 2,导入风控指纹,加强安全 \n 3,广告业配置和营业网点"

                                  delegate:self

                                  cancelButtonTitle:@"确定"

                                  otherButtonTitles:@"马上更新",nil];

            alert.tag = 105;

            [alert show];

        }

    } failure:^(NSURLSessionDataTask * _Nullable task, NSError *_Nonnull error) {

        

    }];

#endif


 NSDictionary *para =@{@"application":@"Version.Req",

                           };

    

    [[YFRequestsharedInstance] requestWithDictionary:para hasLoading:NO completion:^(BOOL success, id responseData) {

        

        if ([responseData[@"msgExt"]isEqualToString:@"1"]) {

            UIAlertView *alert = [[UIAlertViewalloc]

                                  initWithTitle:@"检测到有新的版本"

                                  message:@" 1,增加分享功能。\n 2,导入风控指纹,加强安全 \n 3,广告业配置和营业网点"

                                  delegate:self

                                  cancelButtonTitle:nil

                                  otherButtonTitles:@"马上更新",nil];

            alert.tag =105;

            [alert show];

            

        }

    }];




0 0
原创粉丝点击