diff --git a/Classes/GameListViewController.h b/Classes/GameListViewController.h index 95ac84d..f4f580d 100644 --- a/Classes/GameListViewController.h +++ b/Classes/GameListViewController.h @@ -8,10 +8,16 @@ #import #import "GameCell.h" +#import -@interface GameListViewController : UIViewController { +@interface GameListViewController : UIViewController { IBOutlet GameCell *gameCell; NSMutableArray *games; +#ifdef FAKE_CORE_LOCATION + FTLocationSimulator *locationManager; +#else + CLLocationManager *locationManager; +#endif } @property (nonatomic, retain) IBOutlet UIButton *reloadBtn; @@ -22,6 +28,6 @@ - (IBAction)reloadBtnPressed; - (IBAction)logoutBtnPressed; -- (void)getNearbyLayers; +- (void)refreshNearbyLayers; @end diff --git a/Classes/GameListViewController.m b/Classes/GameListViewController.m index 455b578..d20a32c 100644 --- a/Classes/GameListViewController.m +++ b/Classes/GameListViewController.m @@ -21,6 +21,7 @@ - (void)dealloc { [selectedIndex release]; [tableView release]; [reloadBtn release]; + [locationManager release]; [super dealloc]; } @@ -46,22 +47,43 @@ - (void)loadView { - (void)viewDidLoad { [super viewDidLoad]; games = [[NSMutableArray alloc] init]; - [self getNearbyLayers]; + [self refreshNearbyLayers]; } - (IBAction)reloadBtnPressed { - [self getNearbyLayers]; + [self refreshNearbyLayers]; } - (IBAction)logoutBtnPressed { [[LQClient single] logout]; } -- (void)getNearbyLayers { - [[LQClient single] getNearbyLayers:^(NSError *error, NSDictionary *response){ +- (void)refreshNearbyLayers { + if (!locationManager) { +#ifdef FAKE_CORE_LOCATION + locationManager = [[FTLocationSimulator alloc] init]; +#else + locationManager = [[CLLocationManager alloc] init]; +#endif + locationManager.distanceFilter = 1.0; + locationManager.delegate = self; + } + + [locationManager startUpdatingLocation]; + +} + +- (void)locationManager:(CLLocationManager *)manager + didUpdateToLocation:(CLLocation *)newLocation + fromLocation:(CLLocation *)oldLocation { + + [[LQClient single] getNearbyLayers:newLocation withCallback:^(NSError *error, NSDictionary *response){ self.games = [response objectForKey:@"nearby"]; + NSLog(@"Found games: %@", self.games); [self.tableView reloadData]; }]; + + [locationManager stopUpdatingLocation]; } - (NSString *)urlForGameAtIndex:(NSInteger)index { diff --git a/Classes/GeoloqiReadClient.m b/Classes/GeoloqiReadClient.m index bf0d4c8..d9ba4cd 100644 --- a/Classes/GeoloqiReadClient.m +++ b/Classes/GeoloqiReadClient.m @@ -17,6 +17,7 @@ #define TAG_DEVICE_ID_SENT 1 #define TAG_MESSAGE_RECEIVED 2 +#define VERBOSE 0 @implementation GeoloqiReadClient @@ -66,17 +67,29 @@ - (void)reconnect // After the client finishes writing the UUID, start listening for new data - (void)onSocket:(AsyncSocket *)sock didWriteDataWithTag:(long)tag { - DLog(@"[Read] Did write data with tag %d", tag); + if(VERBOSE) + DLog(@"[Read] Did write data with tag %d", tag); [asyncSocket readDataToData:[AsyncSocket CRLFData] withTimeout:-1 tag:TAG_MESSAGE_RECEIVED]; } - (void)onSocket:(AsyncSocket *)sock didReadData:(NSData *)data withTag:(long)tag { - DLog(@"[Read] Did read data with tag %d: %@", tag, data); + if(VERBOSE) + DLog(@"[Read] Did read data with tag %d: %@", tag, data); + + if([data isEqualToData:[@"ok\r\n" dataUsingEncoding:NSUTF8StringEncoding]]) { + if(VERBOSE) + DLog(@"[Read] Got 'ok' response"); + [asyncSocket readDataToData:[AsyncSocket CRLFData] withTimeout:-1 tag:TAG_MESSAGE_RECEIVED]; + return; + } + NSError **err; NSDictionary *dict; + // DLog(@"[Read] String: %@", [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]); + dict = [[CJSONDeserializer deserializer] deserialize:data error:err]; DLog(@"[Read] Message: %@", dict); diff --git a/Classes/GeoloqiSocketClient.h b/Classes/GeoloqiSocketClient.h index f1bf65e..881efa7 100644 --- a/Classes/GeoloqiSocketClient.h +++ b/Classes/GeoloqiSocketClient.h @@ -32,8 +32,6 @@ - (NSData *)dataFromLocation:(CLLocation *)location; - (void)startMonitoringLocation; - (void)stopMonitoringLocation; - -// TODO: Make a delegate protocol. -// TODO: Send CLLocation to server. +- (BOOL)locationUpdateState; @end diff --git a/Classes/GeoloqiSocketClient.m b/Classes/GeoloqiSocketClient.m index 05186fb..e7d540b 100644 --- a/Classes/GeoloqiSocketClient.m +++ b/Classes/GeoloqiSocketClient.m @@ -14,6 +14,8 @@ #define TIMEOUT_SEC 6.0 #define TAG_DEVICE_ID_SENT 1 +#define VERBOSE 0 + #if LITTLE_ENDIAN #pragma pack(push) /* push current alignment to stack */ @@ -47,7 +49,7 @@ - (id) init { // Change to use UDP asyncSocket = [[AsyncUdpSocket alloc] initWithDelegate:self]; - distanceFilterDistance = 1.0; + distanceFilterDistance = 0.5; trackingFrequency = 1; sendingFrequency = 1; uuid = [[MapAttackAppDelegate UUID] retain]; @@ -66,16 +68,15 @@ - (void) dealloc [super dealloc]; } - - (void) normalConnect { NSError *error = nil; NSString *host = LQ_WRITE_SOCKET_HOST; UInt16 port = LQ_WRITE_SOCKET_PORT; + + DLog(@"[Write] Connecting to %@:%i", host, port); - DLog(@"[Write] Connecting to %@:%i", host, port); - // Change to use UDP if (![asyncSocket connectToHost:LQ_WRITE_SOCKET_HOST onPort:LQ_WRITE_SOCKET_PORT error:&error]) { @@ -85,7 +86,9 @@ - (void) normalConnect #pragma mark - - +- (BOOL)locationUpdateState { + return locationUpdatesOn; +} - (void)startMonitoringLocation { if (!locationManager) { @@ -153,39 +156,46 @@ - (void)locationManager:(CLLocationManager *)manager // object:self]; NSData *data = [self dataFromLocation:newLocation]; - DLog(@"[Write] Sending location data: %@", data); + if(VERBOSE) + DLog(@"[Write] Sending location data: %@", data); [asyncSocket sendData:data toHost:LQ_WRITE_SOCKET_HOST port:LQ_WRITE_SOCKET_PORT withTimeout:10.0 tag:TAG_DEVICE_ID_SENT]; //Look for ack back [asyncSocket receiveWithTimeout:30.0 tag:TAG_DEVICE_ID_SENT]; } else { #if LQ_LOCMAN_DEBUG - DLog(@"[Write] Location update (to %@; from %@) rejected", newLocation, oldLocation); + if(VERBOSE) + DLog(@"[Write] Location update (to %@; from %@) rejected", newLocation, oldLocation); #endif } } - (void)onUdpSocket:(AsyncUdpSocket *)sock didSendDataWithTag:(long)tag; { - DLog(@"[Write] did send"); + if(VERBOSE) + DLog(@"[Write] did send"); } - (void)onUdpSocket:(AsyncUdpSocket *)sock didNotSendDataWithTag:(long)tag dueToError:(NSError *)error; { - DLog(@"[Write] did not get ack back"); + if(VERBOSE) + DLog(@"[Write] did not get ack back"); } - (BOOL)onUdpSocket:(AsyncUdpSocket *)sock didReceiveData:(NSData *)data withTag:(long)tag fromHost:(NSString *)host port:(UInt16)port; { //TODO: determine if this is a valid packet - DLog(@"[Write] Recieved packet back from server: %@", data); + if(VERBOSE) + DLog(@"[Write] Recieved packet back from server: %@", data); if (data.length == sizeof(uint32_t)) { uint32_t time = OSSwapBigToHostInt32(*(uint32_t *)data.bytes); - DLog(@"[Write] Accepted packet with timestamp: %u", time); + if(VERBOSE) + DLog(@"[Write] Accepted packet with timestamp: %u", time); return YES; } else { - DLog(@"[Write] packet invalid size: %d", data.length); + if(VERBOSE) + DLog(@"[Write] packet invalid size: %d", data.length); return NO; } } @@ -224,7 +234,8 @@ - (NSData *)dataFromLocation:(CLLocation *)location { // DLog(@"Offset of command: %lu", offsetof(LQUpdatePacket, f.command)); // DLog(@"Offset of date: %lu", offsetof(LQUpdatePacket, f.date)); - DLog(@"[Write] Sending timestamp: %d", update.f.date); + // if(VERBOSE) + DLog(@"[Write] Sending location update %@", [NSData dataWithBytes:update.bytes length:sizeof(update.bytes)]); //Swap endianness of each 16 bit int update.f.date = OSSwapHostToBigInt32(update.f.date); diff --git a/Classes/LQClient.h b/Classes/LQClient.h index d36d062..4609b2c 100644 --- a/Classes/LQClient.h +++ b/Classes/LQClient.h @@ -7,6 +7,7 @@ // #import +#import #import "ASIHTTPRequest.h" #import "ASIFormDataRequest.h" @@ -21,7 +22,7 @@ typedef void (^LQHTTPRequestCallback)(NSError *error, NSDictionary *response); @interface LQClient : NSObject { // NSMutableArray *queue; - ASIHTTPRequest *authenticationRequest; +// ASIHTTPRequest *authenticationRequest; } @property (nonatomic, copy) NSString *accessToken; @@ -34,7 +35,7 @@ typedef void (^LQHTTPRequestCallback)(NSError *error, NSDictionary *response); - (BOOL)isLoggedIn; // - (NSString *)refreshToken; - (void)sendPushToken:(NSString *)token withCallback:(LQHTTPRequestCallback)callback; -- (void)getNearbyLayers:(LQHTTPRequestCallback)callback; +- (void)getNearbyLayers:(CLLocation *)location withCallback:(LQHTTPRequestCallback)callback; - (void)createNewAccountWithEmail:(NSString *)email initials:(NSString *)initials callback:(LQHTTPRequestCallback)callback; - (void)joinGame:(NSString *)layer_id withToken:(NSString *)group_token; - (void)logout; diff --git a/Classes/LQClient.m b/Classes/LQClient.m index d0d08f2..6564208 100644 --- a/Classes/LQClient.m +++ b/Classes/LQClient.m @@ -38,7 +38,6 @@ - (id) init } - (void)dealloc { - // [queue release]; [super dealloc]; } @@ -260,8 +259,10 @@ - (void)sendPushToken:(NSString *)token withCallback:(LQHTTPRequestCallback)call [self runRequest:request callback:callback]; } -- (void)getNearbyLayers:(LQHTTPRequestCallback)callback { - NSURL *url = [self urlWithPath:[NSString stringWithFormat:@"layer/nearby?latitude=45.5246&longitude=-122.6843&application_id=%@", MapAttackAppID]]; +- (void)getNearbyLayers:(CLLocation *)location withCallback:(LQHTTPRequestCallback)callback { + NSURL *url = [self urlWithPath:[NSString stringWithFormat:@"layer/nearby?latitude=%f&longitude=%f&application_id=%@", + //45.5246, -122.6843, MapAttackAppID]]; + location.coordinate.latitude, location.coordinate.longitude, MapAttackAppID]]; __block ASIHTTPRequest *request; if([self isLoggedIn]) { request = [self userRequestWithURL:url]; diff --git a/Classes/LQPushHandler.h b/Classes/LQPushHandler.h new file mode 100644 index 0000000..d1ab9a5 --- /dev/null +++ b/Classes/LQPushHandler.h @@ -0,0 +1,29 @@ +// +// LQPushHandler.h +// Geoloqi +// +// Created by Aaron Parecki on 12/23/10. +// Copyright 2010 Geoloqi.com. All rights reserved. +// + +#import +#import + +enum { + kLQPushAlertGeonote = 0, + kLQPushAlertShutdown, + kLQPushAlertStart +}; + +@interface LQPushHandler : NSObject { + NSString *lastAlertURL; +} + +@property (nonatomic, retain) NSString *lastAlertURL; + +- (id)myInit; +- (void)handlePush:(UIApplication *)application notification:(NSDictionary *)userInfo; +- (void)handleLocalNotificationFromApp:(UIApplication *)app notif:(UILocalNotification *)notif; +- (void)handleLaunch:(NSDictionary *)launchOptions; + +@end diff --git a/Classes/LQPushHandler.m b/Classes/LQPushHandler.m new file mode 100644 index 0000000..aefd483 --- /dev/null +++ b/Classes/LQPushHandler.m @@ -0,0 +1,219 @@ +// +// LQPushHandler.m +// Geoloqi +// +// Created by Aaron Parecki on 12/23/10. +// Copyright 2010 Geoloqi.com. All rights reserved. +// + +#import "LQPushHandler.h" +#import "CJSONSerializer.h" +#import "MapAttack.h" +#import "MapAttackAppDelegate.h" + +@implementation LQPushHandler + +@synthesize lastAlertURL; + +- (id)myInit { + self = [super init]; + lastAlertURL = [[NSString alloc] init]; + NSLog(@"Alloc url: %@", lastAlertURL); + return self; +} + +/** + * This is called from application: didReceiveRemoteNotification: which is called regardless of whether + * the app is in the foreground or background, but only if it is currently running. + */ +- (void)handlePush:(UIApplication *)application notification:(NSDictionary *)userInfo { + NSString *title; + + // Push was received while the app was in the foreground + if(application.applicationState == UIApplicationStateActive) { + NSDictionary *location = [userInfo valueForKeyPath:@"lqloc"]; + if(location) { + NSLog(@"Got some location data! Yeah!!"); + + NSDictionary *json = [NSDictionary dictionaryWithObject:[[CJSONSerializer serializer] serializeObject:userInfo] forKey:@"json"]; + [[NSNotificationCenter defaultCenter] postNotificationName:LQMapAttackDataNotification + object:self + userInfo:json]; + return; + } + } + + NSString *type = [userInfo valueForKeyPath:@"geoloqi.type"]; + + if(type && [@"geonote" isEqualToString:type]) { + title = @"MapAttack"; + } else if(type && [@"message" isEqualToString:type]) { + title = @"MapAttack"; + } else { + title = @"MapAttack"; + } + + if([type isEqualToString:@"shutdownPrompt"]){ + if([application applicationState] == UIApplicationStateActive) { + // Received a push notification asking the user if they want to shut off location updates. + // If updates have already been turned off, don't bother actually prompting this. + if([[lqAppDelegate socketClient] locationUpdateState]){ + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title + message:[userInfo valueForKeyPath:@"aps.alert.body"] + delegate:self + cancelButtonTitle:@"No" + otherButtonTitles:@"Yes", nil]; + [alert setTag:kLQPushAlertShutdown]; + [alert show]; + [alert release]; + } + } else { + [[lqAppDelegate socketClient] stopMonitoringLocation]; + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Geoloqi" + message:@"Location tracking is off" + delegate:nil + cancelButtonTitle:nil + otherButtonTitles:@"Ok", nil]; + [alert show]; + [alert release]; + } + } else if([type isEqualToString:@"startPrompt"]) { + if([application applicationState] == UIApplicationStateActive) { + // Received a push notification asking the user if they want to turn on location updates. + // If updates are already on, don't bother actually prompting this. + if([[lqAppDelegate socketClient] locationUpdateState] == NO){ + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title + message:[userInfo valueForKeyPath:@"aps.alert.body"] + delegate:self + cancelButtonTitle:@"No" + otherButtonTitles:@"Yes", nil]; + [alert setTag:kLQPushAlertStart]; + [alert show]; + [alert release]; + } else { + [[lqAppDelegate socketClient] startMonitoringLocation]; + } + } + } else { + if([userInfo valueForKeyPath:@"aps.alert.body"] != nil) { + UIAlertView *alert; + if([userInfo valueForKeyPath:@"geoloqi.link"] != nil) { + alert = [[UIAlertView alloc] initWithTitle:title + message:[userInfo valueForKeyPath:@"aps.alert.body"] + delegate:self + cancelButtonTitle:@"Close" + otherButtonTitles:@"View", nil]; + self.lastAlertURL = [userInfo valueForKeyPath:@"geoloqi.link"]; + NSLog(@"Storing value in lastAlertURL: %@", lastAlertURL); + } else { + alert = [[UIAlertView alloc] initWithTitle:title + message:[userInfo valueForKeyPath:@"aps.alert.body"] + delegate:self + cancelButtonTitle:nil + otherButtonTitles:@"Ok", nil]; + self.lastAlertURL = nil; + } + if([application applicationState] == UIApplicationStateActive) { + [alert show]; + [alert setTag:kLQPushAlertGeonote]; + } else { + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:self.lastAlertURL]]; + } + [alert release]; + } + } +} + +- (void)handleLocalNotificationFromApp:(UIApplication *)app notif:(UILocalNotification *)notif { + // A local notification came in but the app was in the foreground. This method is called immediately, + // so we need to show them the alert and handle the response appropriately. + + if([app applicationState] == UIApplicationStateActive){ + // Don't prompt if tracking is already off. Probably won't happen anymore since the timers are cancelled when tracking is turned off. + if([[lqAppDelegate socketClient] locationUpdateState]){ + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[notif.userInfo objectForKey:@"title"] + message:[notif.userInfo objectForKey:@"description"] + delegate:self + cancelButtonTitle:@"No" + otherButtonTitles:notif.alertAction, nil]; + [alert show]; + [alert setTag:kLQPushAlertShutdown]; + [alert release]; + } + } else { + // The app just launched and it was running in the background. If they hit "Yes" then shut off updates + [[lqAppDelegate socketClient] stopMonitoringLocation]; + } +} + +/** + * This is called when the app is launched from the button on a push notification + */ +- (void)handleLaunch:(NSDictionary *)launchOptions { + + NSLog(@"---- Handling launch from push notification"); + + NSDictionary *data = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]; + if(data == nil) + return; + + NSString *type = [data valueForKeyPath:@"geoloqi.type"]; + + if([type isEqualToString:@"startPrompt"]){ + + [[lqAppDelegate socketClient] startMonitoringLocation]; + lqAppDelegate.tabBarController.selectedIndex = 1; + + }else if([type isEqualToString:@"shutdownPrompt"]){ + + [[lqAppDelegate socketClient] stopMonitoringLocation]; + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"MapAttack" + message:@"Location tracking is off" + delegate:nil + cancelButtonTitle:nil + otherButtonTitles:@"Ok", nil]; + [alert show]; + [alert release]; + }else{ + if([data valueForKeyPath:@"geoloqi.link"] != nil) { + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[data valueForKeyPath:@"geoloqi.link"]]]; + } + } + +} + + +- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { + NSLog(@"URL: %@", lastAlertURL); + + switch([alertView tag]) { + case kLQPushAlertShutdown: + if(buttonIndex == 1){ + // Shut off location tracking now + [[lqAppDelegate socketClient] stopMonitoringLocation]; + } + break; + case kLQPushAlertStart: + if(buttonIndex == 1){ + // Turn on location tracking now + [[lqAppDelegate socketClient] startMonitoringLocation]; + } + break; + case kLQPushAlertGeonote: + if(buttonIndex == 1){ + // Clicked "view" and the push contained a link, so open a web browser + NSLog(@"User clicked View, reading the value from lastAlertURL"); + NSLog(@"Value: %@", self.lastAlertURL); + if(self.lastAlertURL != nil) { + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:self.lastAlertURL]]; + } + } + } +} + +- (void)dealloc { + [lastAlertURL release]; + [super dealloc]; +} + +@end diff --git a/Classes/MapAttackAppDelegate.h b/Classes/MapAttackAppDelegate.h index 2450cf4..aa607b7 100644 --- a/Classes/MapAttackAppDelegate.h +++ b/Classes/MapAttackAppDelegate.h @@ -23,6 +23,7 @@ static NSString *const LQUUIDKey = @"LQUUID"; NSString *deviceToken; } +@property (nonatomic, retain) GeoloqiSocketClient *socketClient; @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet AuthView *authViewController; @property (nonatomic, retain) IBOutlet UITabBarController *tabBarController; diff --git a/Classes/MapAttackAppDelegate.m b/Classes/MapAttackAppDelegate.m index d967213..b01846c 100644 --- a/Classes/MapAttackAppDelegate.m +++ b/Classes/MapAttackAppDelegate.m @@ -17,6 +17,7 @@ @implementation MapAttackAppDelegate @synthesize tabBarController, authViewController; @synthesize geoloqi; @synthesize mapController; +@synthesize socketClient; #pragma mark Application launched - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { diff --git a/Classes/MapViewController.m b/Classes/MapViewController.m index dbf7ded..ffef3c0 100644 --- a/Classes/MapViewController.m +++ b/Classes/MapViewController.m @@ -40,6 +40,7 @@ - (void)loadURL:(NSString *)url { [lqAppDelegate.tabBarController presentModalViewController:[[AuthView alloc] init] animated:YES]; } else { DLog(@"Loading URL in game view %@", url); + [read reconnect]; [webView loadRequest:[NSMutableURLRequest requestWithURL:[NSURL URLWithString:[url stringByAppendingFormat:@"?access_token=%@", [[LQClient single] accessToken]]]]]; } } diff --git a/GameList.xib b/GameList.xib index 995101b..9b6fd22 100644 --- a/GameList.xib +++ b/GameList.xib @@ -42,41 +42,23 @@ 274 YES - + - 306 - {{37, 14}, {244, 43}} + 292 + {320, 411} - - 3 - MQA - - 2 - - - NO - YES + 0.73943662643432617 NO IBCocoaTouchFramework - Nearby Games - - Helvetica - 36 - 16 - - - 1 - MCAwIDAAA + + NSImage + bkg.png - - 1 - 10 - 1 292 - {{105, 354}, {107, 37}} + {{105, 365}, {107, 37}} NO IBCocoaTouchFramework @@ -105,12 +87,11 @@ 274 - {{8, 67}, {300, 274}} + {{6, 67}, {308, 291}} 3 - MQA - + MCAwAA YES IBCocoaTouchFramework @@ -118,13 +99,11 @@ 1 0 65 - 22 - 22 292 - {{238, 354}, {70, 37}} + {{238, 365}, {70, 37}} NO IBCocoaTouchFramework @@ -140,6 +119,18 @@ + + + 292 + {{40, 5}, {239, 57}} + + NO + IBCocoaTouchFramework + + NSImage + MapAttackLogo.png + + {320, 411} @@ -225,10 +216,11 @@ YES - - + + + @@ -243,11 +235,6 @@ - - 5 - - - 13 @@ -263,6 +250,16 @@ + + 30 + + + + + 31 + + + @@ -279,8 +276,10 @@ 23.IBViewBoundsToFrameTransform 28.IBPluginDependency 28.IBViewBoundsToFrameTransform - 5.IBPluginDependency - 5.IBViewBoundsToFrameTransform + 30.IBPluginDependency + 30.IBViewBoundsToFrameTransform + 31.IBPluginDependency + 31.IBViewBoundsToFrameTransform YES @@ -294,7 +293,7 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin - P4AAAL+AAAAAAAAAw6wAAA + P4AAAL+AAABBAAAAw6mAAA com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -302,8 +301,10 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin - P4AAAL+AAABCWAAAwlwAAA + P4AAAL+AAABB3AAAwmoAAA + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + @@ -322,7 +323,7 @@ - 29 + 31 @@ -556,6 +557,14 @@ UIKit.framework/Headers/UIControl.h + + UIImageView + UIView + + IBFrameworkSource + UIKit.framework/Headers/UIImageView.h + + UILabel UIView @@ -682,6 +691,19 @@ YES MapAttack.xcodeproj 3 + + YES + + YES + MapAttackLogo.png + bkg.png + + + YES + {239, 57} + {320, 480} + + 132 diff --git a/MapAttack-Info.plist b/MapAttack-Info.plist index 0b5f99b..e92d2a0 100644 --- a/MapAttack-Info.plist +++ b/MapAttack-Info.plist @@ -26,5 +26,9 @@ NSMainNibFile MainWindow + UIBackgroundModes + + location + diff --git a/MapAttack.xcodeproj/project.pbxproj b/MapAttack.xcodeproj/project.pbxproj index f06d35f..b8d144b 100644 --- a/MapAttack.xcodeproj/project.pbxproj +++ b/MapAttack.xcodeproj/project.pbxproj @@ -28,6 +28,11 @@ 0F12916713F4C809007AAB66 /* FTLocationSimulator.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F12916213F4C809007AAB66 /* FTLocationSimulator.m */; }; 0F12916813F4C809007AAB66 /* RegexKitLite.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F12916513F4C809007AAB66 /* RegexKitLite.m */; }; 0F78A72B141553E000029E9C /* DebugLog.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F78A72A141553E000029E9C /* DebugLog.m */; }; + 0FDBA6321416F0C200F5C8A5 /* LQPushHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 0FDBA6311416F0C200F5C8A5 /* LQPushHandler.m */; }; + 0FEC568E14192F770017CE48 /* MapAttackLogo.png in Resources */ = {isa = PBXBuildFile; fileRef = 0FEC568C14192F770017CE48 /* MapAttackLogo.png */; }; + 0FEC568F14192F770017CE48 /* MapAttackLogo@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0FEC568D14192F770017CE48 /* MapAttackLogo@2x.png */; }; + 0FEC56921419300F0017CE48 /* bkg.png in Resources */ = {isa = PBXBuildFile; fileRef = 0FEC56901419300F0017CE48 /* bkg.png */; }; + 0FEC56931419300F0017CE48 /* bkg@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0FEC56911419300F0017CE48 /* bkg@2x.png */; }; 0FFD5EBA140C25D6008BC18B /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 0FFD5EB8140C25D6008BC18B /* Icon.png */; }; 0FFD5EBB140C25D6008BC18B /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0FFD5EB9140C25D6008BC18B /* Icon@2x.png */; }; 0FFD5ECA140F218D008BC18B /* LQClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 0FFD5EC9140F218D008BC18B /* LQClient.m */; }; @@ -48,8 +53,6 @@ 0FFD5FA4140F4396008BC18B /* GameListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0FFD5FA3140F4396008BC18B /* GameListViewController.m */; }; 0FFD6083140FF95B008BC18B /* AuthView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0FFD6081140FF95B008BC18B /* AuthView.m */; }; 0FFD6084140FF95B008BC18B /* AuthView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0FFD6082140FF95B008BC18B /* AuthView.xib */; }; - 0FFD615514100C17008BC18B /* bkg.png in Resources */ = {isa = PBXBuildFile; fileRef = 0FFD615314100C17008BC18B /* bkg.png */; }; - 0FFD615614100C17008BC18B /* bkg@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0FFD615414100C17008BC18B /* bkg@2x.png */; }; 0FFD63401410397D008BC18B /* GameCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 0FFD633F1410397D008BC18B /* GameCell.m */; }; 0FFD634C14103A16008BC18B /* GameCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0FFD634B14103A16008BC18B /* GameCell.xib */; }; 0FFD65FA1412C718008BC18B /* initialFrame.png in Resources */ = {isa = PBXBuildFile; fileRef = 0FFD65F81412C718008BC18B /* initialFrame.png */; }; @@ -116,6 +119,12 @@ 0F12916513F4C809007AAB66 /* RegexKitLite.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RegexKitLite.m; sourceTree = ""; }; 0F78A729141553E000029E9C /* DebugLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugLog.h; sourceTree = ""; }; 0F78A72A141553E000029E9C /* DebugLog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DebugLog.m; sourceTree = ""; }; + 0FDBA6301416F0C200F5C8A5 /* LQPushHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LQPushHandler.h; sourceTree = ""; }; + 0FDBA6311416F0C200F5C8A5 /* LQPushHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LQPushHandler.m; sourceTree = ""; }; + 0FEC568C14192F770017CE48 /* MapAttackLogo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = MapAttackLogo.png; path = Resources/MapAttackLogo.png; sourceTree = ""; }; + 0FEC568D14192F770017CE48 /* MapAttackLogo@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "MapAttackLogo@2x.png"; path = "Resources/MapAttackLogo@2x.png"; sourceTree = ""; }; + 0FEC56901419300F0017CE48 /* bkg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = bkg.png; path = Resources/bkg.png; sourceTree = ""; }; + 0FEC56911419300F0017CE48 /* bkg@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "bkg@2x.png"; path = "Resources/bkg@2x.png"; sourceTree = ""; }; 0FFD5EB8140C25D6008BC18B /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = ""; }; 0FFD5EB9140C25D6008BC18B /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon@2x.png"; sourceTree = ""; }; 0FFD5EC8140F218D008BC18B /* LQClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LQClient.h; sourceTree = ""; }; @@ -154,8 +163,6 @@ 0FFD6080140FF95B008BC18B /* AuthView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthView.h; sourceTree = ""; }; 0FFD6081140FF95B008BC18B /* AuthView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AuthView.m; sourceTree = ""; }; 0FFD6082140FF95B008BC18B /* AuthView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = AuthView.xib; path = Classes/AuthView.xib; sourceTree = ""; }; - 0FFD615314100C17008BC18B /* bkg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bkg.png; sourceTree = ""; }; - 0FFD615414100C17008BC18B /* bkg@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "bkg@2x.png"; sourceTree = ""; }; 0FFD633E1410397D008BC18B /* GameCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameCell.h; sourceTree = ""; }; 0FFD633F1410397D008BC18B /* GameCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GameCell.m; sourceTree = ""; }; 0FFD634B14103A16008BC18B /* GameCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GameCell.xib; sourceTree = ""; }; @@ -236,6 +243,8 @@ 0FFD66AA1412D719008BC18B /* MapAttackAuth.m */, 0FFD68551413F3F8008BC18B /* HowToPlay.h */, 0FFD68561413F3F8008BC18B /* HowToPlay.m */, + 0FDBA6301416F0C200F5C8A5 /* LQPushHandler.h */, + 0FDBA6311416F0C200F5C8A5 /* LQPushHandler.m */, ); path = Classes; sourceTree = ""; @@ -412,8 +421,10 @@ 0FFD5EB9140C25D6008BC18B /* Icon@2x.png */, 0FFD65F81412C718008BC18B /* initialFrame.png */, 0FFD65F91412C718008BC18B /* initialFrame@2x.png */, - 0FFD615314100C17008BC18B /* bkg.png */, - 0FFD615414100C17008BC18B /* bkg@2x.png */, + 0FEC568C14192F770017CE48 /* MapAttackLogo.png */, + 0FEC568D14192F770017CE48 /* MapAttackLogo@2x.png */, + 0FEC56901419300F0017CE48 /* bkg.png */, + 0FEC56911419300F0017CE48 /* bkg@2x.png */, 0FFD6082140FF95B008BC18B /* AuthView.xib */, 2840D7CD1179279E00D7F93C /* MapView.xib */, 282CCBFD0DB6C98000C4EA27 /* GameList.xib */, @@ -497,8 +508,6 @@ 0FFD5EBA140C25D6008BC18B /* Icon.png in Resources */, 0FFD5EBB140C25D6008BC18B /* Icon@2x.png in Resources */, 0FFD6084140FF95B008BC18B /* AuthView.xib in Resources */, - 0FFD615514100C17008BC18B /* bkg.png in Resources */, - 0FFD615614100C17008BC18B /* bkg@2x.png in Resources */, 0FFD634C14103A16008BC18B /* GameCell.xib in Resources */, 0FFD65FA1412C718008BC18B /* initialFrame.png in Resources */, 0FFD65FB1412C718008BC18B /* initialFrame@2x.png in Resources */, @@ -510,6 +519,10 @@ 0FFD68E8141402F4008BC18B /* map-icon@2x.png in Resources */, 0FFD68E9141402F4008BC18B /* nearby-games-icon.png in Resources */, 0FFD68EA141402F4008BC18B /* nearby-games-icon@2x.png in Resources */, + 0FEC568E14192F770017CE48 /* MapAttackLogo.png in Resources */, + 0FEC568F14192F770017CE48 /* MapAttackLogo@2x.png in Resources */, + 0FEC56921419300F0017CE48 /* bkg.png in Resources */, + 0FEC56931419300F0017CE48 /* bkg@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -556,6 +569,7 @@ 0FFD66AB1412D719008BC18B /* MapAttackAuth.m in Sources */, 0FFD68581413F3F8008BC18B /* HowToPlay.m in Sources */, 0F78A72B141553E000029E9C /* DebugLog.m in Sources */, + 0FDBA6321416F0C200F5C8A5 /* LQPushHandler.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -602,7 +616,7 @@ OTHER_CFLAGS = "-DDEBUG"; OTHER_LDFLAGS = "-lxml2"; PREBINDING = NO; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = "CF7AE5F7-6348-4BEE-B4CD-499DC0FB6C89"; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = "2101AEA6-D7CA-4374-B845-BE08FF4C67C1"; SDKROOT = iphoneos; }; name = Debug; diff --git a/Resources/MapAttackLogo.png b/Resources/MapAttackLogo.png new file mode 100644 index 0000000..1b71153 Binary files /dev/null and b/Resources/MapAttackLogo.png differ diff --git a/Resources/MapAttackLogo@2x.png b/Resources/MapAttackLogo@2x.png new file mode 100644 index 0000000..f4b61e0 Binary files /dev/null and b/Resources/MapAttackLogo@2x.png differ diff --git a/Resources/bkg.png b/Resources/bkg.png index c0ce128..3a6333d 100644 Binary files a/Resources/bkg.png and b/Resources/bkg.png differ diff --git a/Resources/bkg@2x.png b/Resources/bkg@2x.png index 07ad537..5afed6d 100644 Binary files a/Resources/bkg@2x.png and b/Resources/bkg@2x.png differ diff --git a/bkg.png b/bkg.png deleted file mode 100644 index c0ce128..0000000 Binary files a/bkg.png and /dev/null differ diff --git a/bkg@2x.png b/bkg@2x.png deleted file mode 100644 index 07ad537..0000000 Binary files a/bkg@2x.png and /dev/null differ