Explorar el Código

Apex mobile

替换网络请求接口
引入部分通用工具类
Ray Zhang hace 8 años
padre
commit
621a2a259c

BIN
Apex Mobile/Apex Mobile.xcodeproj/project.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate


+ 0 - 19
Apex Mobile/Apex Mobile/ApexMobileAppDelegate.h

@@ -1,19 +0,0 @@
-//
-//  ApexMobileAppDelegate.h
-//  Apex Mobile
-//
-//  Created by Ray on 14-2-24.
-//  Copyright (c) 2014年 United Software Applications, Inc. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-#import <GoogleMaps/GoogleMaps.h>
-@interface ApexMobileAppDelegate : UIResponder <UIApplicationDelegate>
-
-@property (strong, nonatomic) UIWindow *window;
-@property (strong,nonatomic) NSString* user;
-@property (strong,nonatomic) NSString * password;
-@property (strong,nonatomic) NSString * sessionid;
-@property (strong,nonatomic) NSString * duid;
--(void)Logout;
-@end

+ 0 - 110
Apex Mobile/Apex Mobile/ApexMobileAppDelegate.m

@@ -1,110 +0,0 @@
-//
-//  ApexMobileAppDelegate.m
-//  Apex Mobile
-//
-//  Created by Ray on 14-2-24.
-//  Copyright (c) 2014年 United Software Applications, Inc. All rights reserved.
-//
-
-
-#import "ApexMobileAppDelegate.h"
-#import "ApexMobileDB.h"
-#import "ApexMobileNetwork.h"
-#import "AESCrypt.h"
-@implementation ApexMobileAppDelegate
-
-- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
-{
-    // Override point for customization after application launch.
-    [GMSServices provideAPIKey:@"AIzaSyBqS2pF7m1DlR5zwhAX_rBSD_9bTnpjYbQ"];
-    if (! [ApexMobileDB initializeDb])
-        // TODO: alert the user!
-        DebugLog(@"couldn't init db");
-    
-    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"];
-    
-  
-    self.password= [AESCrypt decrypt:[defaults stringForKey:@"password"] password:@"usai"];
-
-    
-    return YES;
-}
--(void)Logout
-{
-    self.user = nil;
-    self.password=nil;
-    self.sessionid=nil;
-    [ApexMobileNetwork Logout];
-    NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
-    [defaults setBool:false forKey:@"autologin"];
-    
-    
-    [defaults synchronize];
-    [UIApplication sharedApplication].applicationIconBadgeNumber = 0;
-    [[UIApplication sharedApplication] cancelAllLocalNotifications ];
-    //self.duid = nil;
-}
-- (void)applicationWillResignActive:(UIApplication *)application
-{
-    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
-    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
-}
-
-- (void)applicationDidEnterBackground:(UIApplication *)application
-{
-    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
-    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
-}
-
-- (void)applicationWillEnterForeground:(UIApplication *)application
-{
-    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
-}
-
-- (void)applicationDidBecomeActive:(UIApplication *)application
-{
-    [[UIApplication sharedApplication] cancelAllLocalNotifications ];
-    
-    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
-}
-
-- (void)applicationWillTerminate:(UIApplication *)application
-{
-    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
-}
-
-- (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);
-    
-    //注册成功,将deviceToken保存到应用服务器数据库中
-}
-- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{
-    // 处理推送消息
-    NSLog(@"userinfo:%@",userInfo);
-    
-    NSLog(@"收到推送消息:%@",[[userInfo objectForKey:@"aps"] objectForKey:@"alert"]);
-  
-    NSDictionary* objaps = [userInfo objectForKey:@"aps"];
-    [UIApplication sharedApplication].applicationIconBadgeNumber = [[objaps valueForKey:@"badge"] integerValue];
-    [[NSNotificationCenter defaultCenter] postNotificationName:@"new notification" object:nil];
-}
-
-- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
-    NSLog(@"Registfail%@",error);
-}
-@end

+ 0 - 45
Apex Mobile/Apex Mobile/ApexMobileNetwork.h

@@ -1,45 +0,0 @@
-//
-//  ApexMobileNetwork.h
-//  Apex Mobile
-//
-//  Created by Ray on 14-2-28.
-//  Copyright (c) 2014年 United Software Applications, Inc. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import <sqlite3.h>
-#import "ApexMobileAppDelegate.h"
-#import "ApexMobileDB.h"
-#import "Constant.h"
-#import "Reachability.h"
-#import "PageData.h"
-#import "DetailContent.h"
-#import <MessageUI/MessageUI.h>
-#import <MessageUI/MFMailComposeViewController.h>
-//#define TEST
-@interface ApexMobileNetwork : NSObject
-+(void)Logout ;
-+(int)Authorize : (NSString*) user password:(NSString*) password ;
-+(int)parse_authinfo : (NSData *) json user:(NSString*) user password:(NSString*) password;
-+(NSData*)get_json : (NSString*) url parameters:(NSMutableDictionary *) params;// delegate:(id < NSURLConnectionDelegate >)delegate;
-//+(int) get_announcements: (NSString*)lastid limit:int limit ;//delegate:(id < NSURLConnectionDelegate >)delegate;
-+(NSData*)pull_message : (int) offset;
-+(NSData*)get_MessageDetail: (int) offset limit:(int) limit from:(NSString*) sid to:(NSString*) eid;
-+(NSData*)get_announcements : (NSString*) id limit: (int) limit ;
-+(NSData*)get_marketnews : (NSString*) id limit: (int) limit ;
-+(void)post_without_return : (NSString*) url parameters:(NSMutableDictionary *) params;
-+(int) get_recordcount: (NSMutableDictionary *) params ;//delegate:(id < NSURLConnectionDelegate >)delegate;
-+(PageData*) get_pagedata: (NSMutableDictionary *) params;
-+(DetailContent*) get_detailcontent: (NSMutableDictionary *) params;
-+(bool) IsNetworkAvailable;
-+(int) delAllMessage:(NSString*) before;
-//+(bool) IsHostAvailable : (NSString*) url;
-+(int) RetrievePassword : (NSString*) user  email:(NSString*) email;
-+(int) ChangePassword : (NSString*) newpass user:(NSString*) user oldpass:(NSString*) oldpass;
-+(bool) UpdateServiceLocation;
-
-//+(void) testmail;
-//+(void) testmail1 :(UIViewController*) caller;
-@end
-
-

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 984
Apex Mobile/Apex Mobile/ApexMobileNetwork.m


Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio