diff --git a/HeroApp/HeroApp/ASMapKit/JPSThumbnailAnnotationView.m b/HeroApp/HeroApp/ASMapKit/JPSThumbnailAnnotationView.m index 543c8cc..416ef71 100644 --- a/HeroApp/HeroApp/ASMapKit/JPSThumbnailAnnotationView.m +++ b/HeroApp/HeroApp/ASMapKit/JPSThumbnailAnnotationView.m @@ -57,7 +57,7 @@ - (void)setupView { [self setupImageView]; [self setupTitleLabel]; [self setupSubtitleLabel]; - [self setupDisclosureButton]; + //[self setupDisclosureButton]; [self setLayerProperties]; [self setDetailGroupAlpha:0.0f]; } @@ -72,7 +72,7 @@ - (void)setupImageView { } - (void)setupTitleLabel { - _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(-32.0f, 16.0f, 168.0f, 20.0f)]; + _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, 16.0f, 130.0f, 20.0f)]; _titleLabel.textColor = [UIColor darkTextColor]; _titleLabel.font = [UIFont boldSystemFontOfSize:17]; _titleLabel.minimumScaleFactor = 0.8f; @@ -81,9 +81,10 @@ - (void)setupTitleLabel { } - (void)setupSubtitleLabel { - _subtitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(-32.0f, 36.0f, 168.0f, 20.0f)]; + _subtitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, 36.0f, 100.0f, 20.0f)]; _subtitleLabel.textColor = [UIColor grayColor]; _subtitleLabel.font = [UIFont systemFontOfSize:12.0f]; + _subtitleLabel.text = @"Last Location"; [self addSubview:_subtitleLabel]; } @@ -222,7 +223,7 @@ - (void)animateBubbleWithDirection:(JPSThumbnailAnnotationViewAnimationDirection BOOL growing = (animationDirection == JPSThumbnailAnnotationViewAnimationDirectionGrow); // Image [UIView animateWithDuration:kJPSThumbnailAnnotationViewAnimationDuration animations:^{ - CGFloat xOffset = (growing ? -1 : 1) * kJPSThumbnailAnnotationViewExpandOffset/2.0f; + CGFloat xOffset = (growing ? -1 : 1) * kJPSThumbnailAnnotationViewExpandOffset/3.0f; self.imageView.frame = CGRectOffset(self.imageView.frame, xOffset, 0.0f); } completion:^(BOOL finished) { if (animationDirection == JPSThumbnailAnnotationViewAnimationDirectionShrink) { @@ -240,7 +241,7 @@ - (void)animateBubbleWithDirection:(JPSThumbnailAnnotationViewAnimationDirection animation.duration = kJPSThumbnailAnnotationViewAnimationDuration; // Stroke & Shadow From/To Values - CGRect largeRect = CGRectInset(self.bounds, -kJPSThumbnailAnnotationViewExpandOffset/2.0f, 0.0f); + CGRect largeRect = CGRectInset(self.bounds, -kJPSThumbnailAnnotationViewExpandOffset/3.0f, 0.0f); CGPathRef fromPath = [self newBubbleWithRect:growing ? self.bounds : largeRect]; animation.fromValue = (__bridge id)fromPath; diff --git a/HeroApp/HeroApp/AppDelegate.m b/HeroApp/HeroApp/AppDelegate.m index e870046..06f91df 100644 --- a/HeroApp/HeroApp/AppDelegate.m +++ b/HeroApp/HeroApp/AppDelegate.m @@ -7,6 +7,8 @@ // #import "AppDelegate.h" +#import +#import "ServerManager.h" @interface AppDelegate () @@ -47,23 +49,28 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( if(!ReadValue(SOUND_FIND_PHONE_THUR_HIRO)){ StoreValue(SOUND_FIND_PHONE_THUR_HIRO,@"HiroTone1"); } - + //////////////////////////// + NSArray *centralManagerIdentifiers = + launchOptions[UIApplicationLaunchOptionsBluetoothCentralsKey]; + //////////////////////////// [self registerForRemoteNotification]; return YES; } + - (void)registerForRemoteNotification{ - if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) - { - [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]]; - [[UIApplication sharedApplication] registerForRemoteNotifications]; - } - else - { - [[UIApplication sharedApplication] registerForRemoteNotificationTypes: - (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)]; - } +// if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) +// { +// [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]]; +// [[UIApplication sharedApplication] registerForRemoteNotifications]; +// } +// else +// { +// [[UIApplication sharedApplication] registerForRemoteNotificationTypes: +// (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)]; +// } + } - (void)peripheralFound:(NSNotification *)note{ @@ -155,8 +162,19 @@ - (void)applicationWillTerminate:(UIApplication *)application { } + +- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forLocalNotification:(UILocalNotification *)notification completionHandler:(void(^)())completionHandler { + NSLog(@"-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--+-+-+-+-+"); + [[ServerManager sharedInstance]stopPlayingAlarmSound]; + + + if(completionHandler != nil) //Finally call completion handler if its not nil + completionHandler(); +} + - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification { + if(notification.userInfo[@"shouldShowInApp"] && [notification.userInfo[@"shouldShowInApp"]boolValue]){ static UIAlertView *view; @@ -172,6 +190,7 @@ - (void)application:(UIApplication *)application didReceiveLocalNotification:(UI } + - (void)deviceDidUpdateProperty:(NSNotification *)note{ HeroActor *actor = note.object; NSString *propertyName = note.userInfo[@"name"]; diff --git a/HeroApp/HeroApp/Base.lproj/Main.storyboard b/HeroApp/HeroApp/Base.lproj/Main.storyboard index d47f513..3500783 100644 --- a/HeroApp/HeroApp/Base.lproj/Main.storyboard +++ b/HeroApp/HeroApp/Base.lproj/Main.storyboard @@ -1,7 +1,7 @@ - + - + @@ -49,7 +49,7 @@ - + @@ -119,7 +119,7 @@ - + - +