Commit a374661b authored by zhu's avatar zhu

版本更新

parent 8140cbe6
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
[NSURLProtocol registerClass:[ICRURLProtocol class]]; [NSURLProtocol registerClass:[ICRURLProtocol class]];
NSString * path = [NSSearchPathForDirectoriesInDomains(NSDocumentationDirectory, NSUserDomainMask, YES) lastObject]; NSString * path = [NSSearchPathForDirectoriesInDomains(NSDocumentationDirectory, NSUserDomainMask, YES) lastObject];
CLog(@"%@",path); CLog(@"%@",path);
// Required // Required
#if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_7_1 #if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_7_1
...@@ -63,14 +63,11 @@ ...@@ -63,14 +63,11 @@
categories:nil]; categories:nil];
} }
[APService setupWithOption:launchOptions]; [APService setupWithOption:launchOptions];
[self setupBMKMapMgr]; [self setupBMKMapMgr];
_m_appViewControllerMgr = [ICRAppViewControllerManager getAppViewControllerManager]; _m_appViewControllerMgr = [ICRAppViewControllerManager getAppViewControllerManager];
#pragma 版本更新 #pragma 版本更新
[self enterpriseUpdate]; [self enterpriseUpdate];
[self.window makeKeyAndVisible]; [self.window makeKeyAndVisible];
return YES; return YES;
} }
#pragma mark enterprise alertView 企业版提示 #pragma mark enterprise alertView 企业版提示
...@@ -81,9 +78,9 @@ ...@@ -81,9 +78,9 @@
NSString *version = [content valueForKey:@"CFBundleVersion"] ; NSString *version = [content valueForKey:@"CFBundleVersion"] ;
self.version=version; self.version=version;
// 获取服务器更新信息 // 获取服务器更新信息
[ self getDataFromServer]; [ self getDataFromServer];
} }
//请求服务器更新信息 //请求服务器更新信息
- (void)getDataFromServer{ - (void)getDataFromServer{
...@@ -124,7 +121,7 @@ ...@@ -124,7 +121,7 @@
-(void)comperVersion -(void)comperVersion
{ {
NSComparisonResult comResult = [self p_compareVersions: self.version betweenVersion2:self.severVersion]; NSComparisonResult comResult = [self p_compareVersions: self.version betweenVersion2:self.severVersion];
if (comResult == NSOrderedAscending) { if (comResult == NSOrderedAscending) {
//299企业版的更新 @"有新的版本可供下载" //299企业版的更新 @"有新的版本可供下载"
// NSOrderedAscending self.version<self.severVersion // NSOrderedAscending self.version<self.severVersion
...@@ -132,8 +129,8 @@ ...@@ -132,8 +129,8 @@
// NSOrderedSame self.version==self.severVersion // NSOrderedSame self.version==self.severVersion
if (self.severForceUpdate) { if (self.severForceUpdate) {
//强制更新 //强制更新
UIAlertView *alertV = [[UIAlertView alloc]initWithTitle:@"新版本告知" message: @"有新版本发布请您下载最新版本" delegate:self cancelButtonTitle:nil otherButtonTitles: @"去下载", nil]; UIAlertView *alertV = [[UIAlertView alloc]initWithTitle:@"新版本告知" message: @"有新版本发布请您下载最新版本" delegate:self cancelButtonTitle:nil otherButtonTitles: @"去下载", nil];
alertV.tag = 1001; alertV.tag = 1001;
[alertV show]; [alertV show];
}else }else
{ {
...@@ -141,7 +138,7 @@ ...@@ -141,7 +138,7 @@
alertV.tag = 1002; alertV.tag = 1002;
[alertV show]; [alertV show];
} }
}else{ }else{
[IBTLoadingView showProgressLabel:@"暂无新版本"]; [IBTLoadingView showProgressLabel:@"暂无新版本"];
...@@ -154,7 +151,7 @@ ...@@ -154,7 +151,7 @@
- (void) alertView:(UIAlertView *)alertView - (void) alertView:(UIAlertView *)alertView
clickedButtonAtIndex:(NSInteger)buttonIndex { clickedButtonAtIndex:(NSInteger)buttonIndex {
if (alertView.tag==1001) { if (alertView.tag==1001) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:self.severUrl]]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:self.severUrl]];
}else if (alertView.tag==1002) }else if (alertView.tag==1002)
{ {
if (buttonIndex == 1) { if (buttonIndex == 1) {
...@@ -206,7 +203,7 @@ clickedButtonAtIndex:(NSInteger)buttonIndex { ...@@ -206,7 +203,7 @@ clickedButtonAtIndex:(NSInteger)buttonIndex {
[application cancelAllLocalNotifications]; [application cancelAllLocalNotifications];
} }
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
CLog (@"%@", [NSString stringWithFormat:@"Device Token: %@", deviceToken]); CLog (@"%@", [NSString stringWithFormat:@"Device Token: %@", deviceToken]);
[APService registerDeviceToken:deviceToken]; [APService registerDeviceToken:deviceToken];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment