ayjk / aycheckversion Goto Github PK
View Code? Open in Web Editor NEWCheck version from AppStore / 从AppStore检查更新
License: MIT License
Check version from AppStore / 从AppStore检查更新
License: MIT License
代码如下
- (BOOL)isEqualByCompareLastVersion:(NSString *)lastVersion withCurrentVersion:(NSString *)currentVersion { NSArray *lastVersionArray = [lastVersion componentsSeparatedByString:@"."]; NSArray *currentVersionArray = [currentVersion componentsSeparatedByString:@"."]; for (int index = 0; index < lastVersionArray.count; index++) { if ([currentVersionArray[index] integerValue] < [lastVersionArray[index] integerValue]) { return NO; } } return YES; }
判断版本count不同直接返回有更新是个错误的做法,需要一个个比对,其次当前版本需低于最新版本才提示更新,而不是不同就提示更新
这种引导用户跟新的弹窗,如果被苹果发现了会被下架吗?
新版应用已经审核通过好久了,可能由于cdn缓存的原因,访问到的版本信息还是旧的版本信息,而不是审核通过,马上就提示更新。如果在https://itunes.apple.com/lookup?country=cn&bundleId=bundleId&时间戳 后面拼接一个时间戳,就可以解决这个问题吧?
这里报错了,应用检查的时候崩溃了
#11 Thread
NSInvalidArgumentException
data parameter is nil
}
0 CoreFoundation _exceptionPreprocess + 124
1 libobjc.A.dylib objc_exception_throw + 56
2 CoreFoundation -[NSException initWithCoder:]
3 Foundation +[NSJSONSerialization JSONObjectWithData:options:error:] + 76
4 AYCheckVersion __37-[AYCheckManager getInfoFromAppStore]_block_invoke + 116
5 CFNetwork ___75-[__NSURLSessionLocal taskForClass:request:uploadFile:bodyData:completion:]_block_invoke + 32
6 CFNetwork ___49-[__NSCFLocalSessionTask _task_onqueue_didFinish]_block_invoke + 296
7 Foundation ___NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK + 16
8 Foundation -[NSBlockOperation main] + 96
9 Foundation -[__NSOperationInternal _start:] + 604
10 Foundation ___NSOQSchedule_f + 224
11 libdispatch.dylib __dispatch_client_callout + 16
12 libdispatch.dylib __dispatch_queue_drain + 864
13 libdispatch.dylib __dispatch_queue_invoke + 464
14 libdispatch.dylib __dispatch_root_queue_drain + 728
15 libdispatch.dylib __dispatch_worker_thread3 + 112
16 libsystem_pthread.dylib _pthread_wqthread + 1092
17 libsystem_pthread.dylib start_wqthread + 4
您好,这里报错了 在解析 iTunesStore数据的时候 getInfoFromAppStore
NSDictionary *responseDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
这个方法没有 判断 error导致的,应该是 某些情况下 获取数据出现了问题。
非常感谢作者!
这个框架我自己跑了一遍,觉得还是挺好的,给个赞👍,哈哈😄。
结合我自己的经验来说,app有时候也会存在强制更新的情况,否则无法使用app,当然这是非常严重的情况了。
所以我觉得加入一个强制更新的场景可能会更好一些,这个只是我的个人建议哈!
1.需要获得当前是一个网络请求状态.这里可以采用block.
2.需要告知用户是否有更新状态的情况下.可以自定义开发文本.而不是采用APP Store的更新文本.
3.如果没有新版.也应该也要有状态告知当前没有新版.
4.写的不错.Thx.
會發生明明出現提醒版本更新,但跳轉到App Store還是未更新的版本嗎?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.