Ray Zhang 10 лет назад
Родитель
Сommit
9bc09bb3b4

+ 13 - 1
Apex Mobile/Apex Mobile/ApexMobileAppDelegate.m

@@ -20,8 +20,19 @@
     if (! [ApexMobileDB initializeDb])
         // TODO: alert the user!
         DebugLog(@"couldn't init db");
-    [[UIApplication sharedApplication] registerForRemoteNotificationTypes: UIRemoteNotificationTypeBadge |UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert];
     
+    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
+    {
+                UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeBadge |UIUserNotificationTypeSound | UIUserNotificationTypeAlert) categories:nil];
+                [[UIApplication sharedApplication]  registerUserNotificationSettings:settings];
+            [[UIApplication sharedApplication] registerForRemoteNotifications ];
+    }
+    else
+    {
+    [[UIApplication sharedApplication] registerForRemoteNotificationTypes: UIUserNotificationTypeBadge |UIUserNotificationTypeSound | UIUserNotificationTypeAlert];
+    }
+
+
     NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
     self.user = [AESCrypt decrypt:[defaults stringForKey:@"user"] password:@"usai"];
     
@@ -76,6 +87,7 @@
 }
 
 - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)pToken {
+    NSString * sss=[NSString stringWithFormat:@"%@",pToken];
     self.duid = [[[[NSString stringWithFormat:@"%@",pToken] substringWithRange:NSMakeRange(0, 72)] substringWithRange:NSMakeRange(1, 71)] stringByReplacingOccurrencesOfString:@" " withString:@""];
     NSLog(@"regisger success:%@",pToken);
     

+ 1 - 1
Apex Mobile/Apex Mobile/ApexMobileNetwork.h

@@ -16,7 +16,7 @@
 #import "DetailContent.h"
 #import <MessageUI/MessageUI.h>
 #import <MessageUI/MFMailComposeViewController.h>
-#define TEST
+//#define TEST
 @interface ApexMobileNetwork : NSObject
 +(void)Logout ;
 +(int)Authorize : (NSString*) user password:(NSString*) password ;

+ 2 - 0
Apex Mobile/Apex Mobile/Base.lproj/Localizable.strings

@@ -22,6 +22,8 @@
 "new_message" = "New message from Apex";
 "alert_title_error"="Error";
 "alert_msg_upcanotempty"="User&Password can not be empty!";
+"alert_msg_customizefield"="At least keep one field visiable.";
+
 "alert_msg_uecanotempty"="User&Email can not be empty!";
 "ok"="Ok";
 "cancel"="Cancel";

Разница между файлами не показана из-за своего большого размера
+ 327 - 16
Apex Mobile/Apex Mobile/Base.lproj/Main_iPhone.storyboard


+ 1 - 0
Apex Mobile/Apex Mobile/zh-Hans.lproj/Localizable.strings

@@ -22,6 +22,7 @@
 "new_message" = "来自Apex的新消息";
 "alert_title_error"="错误";
 "alert_msg_upcanotempty"="用户名或密码不能为空";
+"alert_msg_customizefield"="至少要有一个可见字段";
 "alert_msg_uecanotempty"="用户名或Email不能为空";
 "ok"="确定";
 "cancel"="取消";

Некоторые файлы не были показаны из-за большого количества измененных файлов