Skip to content

Commit

Permalink
more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
krzd committed Oct 1, 2013
1 parent e73a9b4 commit 736b4bc
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ShnergleApp/AddVenueViewController.m
Expand Up @@ -49,7 +49,7 @@ - (void)addVenue {
if (self.userData[@6] != nil) [address addObject:self.userData[@6]];
if ([address count] == 0) [address addObject:@""];

NSMutableDictionary * params = [@{@"name": self.userData[@1],
NSMutableDictionary *params = [@{@"name": self.userData[@1],
@"category_id": appDelegate.addVenueTypeId,
@"address": [address componentsJoinedByString:@", "],
@"country": !error ? [((CLPlacemark *)placemark[0]).ISOcountryCode lowercaseString] : @"--",
Expand Down
11 changes: 8 additions & 3 deletions ShnergleApp/AroundMeViewController.m
Expand Up @@ -62,6 +62,7 @@ - (IBAction)backToMe:(id)sender {
[self mapView:map didUpdateUserLocation:map.userLocation];
pinDropped = NO;
[self sliderValueChanged:nil];
[Flurry logEvent:@"Tapped Around Me"];
}

- (void)viewDidLoad {
Expand Down Expand Up @@ -175,19 +176,20 @@ - (void)showOverlay {
}

- (void)hideOverlay {
[self.overlay hideAnimated:146 animationDuration:0.5 targetSize:350 contentView:[self overlay]];
[self.overlay hideAnimated:146 animationDuration:0.5 targetSize:350 contentView:self.overlay];
crowdImagesHidden = YES;
[Flurry logEvent:@"Enlarge map"];
}

- (void)showDistanceScroller {
if (self.distanceScrollerView.bounds.origin.y < 64) {
[[self distanceScrollerView] showAnimated:64 animationDelay:0.0 animationDuration:0.5];
[self.distanceScrollerView showAnimated:64 animationDelay:0.0 animationDuration:0.5];
}
}

- (void)hideDistanceScroller {
if (self.distanceScrollerView.frame.origin.y > -64) {
[[self distanceScrollerView] hideAnimated:64 animationDuration:0.8 targetSize:-64 contentView:[self distanceScrollerView]];
[self.distanceScrollerView hideAnimated:64 animationDuration:0.8 targetSize:-64 contentView:self.distanceScrollerView];
}
}

Expand Down Expand Up @@ -225,6 +227,8 @@ - (IBAction)sliderValueChanged:(id)sender {
[map addOverlay:circle];

[[NSUserDefaults standardUserDefaults] setObject:@(self.distanceScroller.value) forKey:@"radius"];

if (sender) [Flurry logEvent:@"Changed distance for map" withParameters:@{@"distance": @(self.distanceScroller.value)}];
}

- (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id<MKOverlay>)overlay {
Expand Down Expand Up @@ -290,6 +294,7 @@ - (void)didTapAtMap:(id)sender {
CGPoint point = [sender locationInView:map];
pinDroppedLocation = [map convertPoint:point toCoordinateFromView:map];
[self sliderValueChanged:nil];
[Flurry logEvent:@"Moved circle on map"];
}

- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation {
Expand Down
2 changes: 1 addition & 1 deletion ShnergleApp/CustomSlidingViewController.m
Expand Up @@ -20,7 +20,7 @@ - (void)viewDidLoad {
self.anchorLeftRevealAmount = NSIntegerMax;
self.topViewController = [self.storyboard instantiateViewControllerWithIdentifier:self.mainController];
if (![self.underLeftViewController isKindOfClass:[MenuViewController class]]) {
self.underLeftViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"AroundMeMenu"];
self.underLeftViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"AroundMeMenu"];
}
[self.topViewController.view addGestureRecognizer:self.panGesture];
}
Expand Down
6 changes: 6 additions & 0 deletions ShnergleApp/FavouritesViewController.m
Expand Up @@ -13,6 +13,7 @@
#import <Toast/Toast+UIView.h>
#import <MapKit/MapKit.h>
#import "UIViewController+CheckIn.h"
#import <FlurrySDK/Flurry.h>

@implementation FavouritesViewController

Expand Down Expand Up @@ -101,6 +102,11 @@ - (void)viewWillDisappear:(BOOL)animated {
man = nil;
}

- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[Flurry logEvent:[NSString stringWithFormat:@"Viewed %@", appDelegate.topViewType]];
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellIdentifier = @"FavCell";
CrowdItem *item = [collectionView dequeueReusableCellWithReuseIdentifier:cellIdentifier forIndexPath:indexPath];
Expand Down
1 change: 1 addition & 0 deletions ShnergleApp/LoginScreenController.m
Expand Up @@ -122,6 +122,7 @@ - (void)alert {

- (IBAction)showInfo:(id)sender {
[[[UIAlertView alloc] initWithTitle:nil message:@"We only take your most basic Facebook info so that we can provide you a service without asking you to fill in forms.\n\nWe will never post to Facebook without your express instruction.\nWe will never share your information with anybody other than in aggregated non-identifiable ways (e.g: '15% of males aged 18-24 attend your venue after seeing this image') without your express permission.\n\nFor more information please see our privacy policy." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show];
[Flurry logEvent:@"Tapped Facebook info"];
}

@end
10 changes: 8 additions & 2 deletions ShnergleApp/OverlayText.m
Expand Up @@ -12,6 +12,7 @@
#import <Toast+UIView.h>
#import <QuartzCore/QuartzCore.h>
#import <CMMapLauncher/CMMapLauncher.h>
#import <FlurrySDK/Flurry.h>

@implementation OverlayText

Expand All @@ -21,10 +22,11 @@ - (IBAction)tappedNavigation:(id)sender {
if ([CMMapLauncher isMapAppInstalled:i]) [alert addButtonWithTitle:[self mapAppToString:i]];
}
[alert show];
[Flurry logEvent:@"Tapped navigation icon on overlay"];
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex != alertView.cancelButtonIndex) [CMMapLauncher launchMapApp:[self stringtToMapApp:[alertView buttonTitleAtIndex:buttonIndex]] forDirectionsTo:[CMMapPoint mapPointWithName:appDelegate.activeVenue[@"name"] coordinate:CLLocationCoordinate2DMake([appDelegate.activeVenue[@"lat"] doubleValue], [appDelegate.activeVenue[@"lon"] doubleValue])]];
if (buttonIndex != alertView.cancelButtonIndex) [CMMapLauncher launchMapApp:[self stringToMapApp:[alertView buttonTitleAtIndex:buttonIndex]] forDirectionsTo:[CMMapPoint mapPointWithName:appDelegate.activeVenue[@"name"] coordinate:CLLocationCoordinate2DMake([appDelegate.activeVenue[@"lat"] doubleValue], [appDelegate.activeVenue[@"lon"] doubleValue])]];
}

- (NSString *)mapAppToString:(CMMapApp)mapApp {
Expand All @@ -46,7 +48,7 @@ - (NSString *)mapAppToString:(CMMapApp)mapApp {
}
}

- (CMMapApp)stringtToMapApp:(NSString *)string {
- (CMMapApp)stringToMapApp:(NSString *)string {
if (!string) return 0;
if ([string isEqualToString:@"Apple Maps"]) return CMMapAppAppleMaps;
if ([string isEqualToString:@"Citymapper"]) return CMMapAppCitymapper;
Expand Down Expand Up @@ -74,6 +76,7 @@ - (IBAction)analytics:(id)sender {
} else {
[[[UIAlertView alloc] initWithTitle:@"Visitor analytics for venue managers and staff will be implemented soon; please check the app store regularly for updates" message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show];
}
[Flurry logEvent:@"Tapped analytics"];
}

- (IBAction)staff:(id)sender {
Expand All @@ -99,6 +102,7 @@ - (IBAction)swipeDown:(id)sender {

- (IBAction)swipeUp:(id)sender {
[self showAnimated:139 animationDelay:0.2 animationDuration:0.5];
[Flurry logEvent:@"Venue slider up"];
}

- (IBAction)tappedGoing:(id)sender {
Expand All @@ -112,6 +116,7 @@ - (IBAction)tappedGoing:(id)sender {
[Request post:@"venue_rsvps/set" params:params callback:^(id response) {
[self didIntent:response];
}];
[Flurry logEvent:@"RSVP'd" withParameters:@{@"type": @"going"}];
}

- (IBAction)tappedThinking:(id)sender {
Expand All @@ -123,6 +128,7 @@ - (IBAction)tappedThinking:(id)sender {
[Request post:@"venue_rsvps/set" params:params callback:^(id response) {
[self didIntent:response];
}];
[Flurry logEvent:@"RSVP'd" withParameters:@{@"type": @"maybe"}];
}

- (void)didIntent:(id)response {
Expand Down
5 changes: 3 additions & 2 deletions ShnergleApp/ProfileViewController.m
Expand Up @@ -10,6 +10,7 @@
#import "Request.h"
#import <Toast/Toast+UIView.h>
#import <ECSlidingViewController/ECSlidingViewController.h>
#import <FlurrySDK/Flurry.h>

@implementation ProfileViewController

Expand Down Expand Up @@ -116,8 +117,8 @@ - (IBAction)signOut:(id)sender {
}

- (IBAction)showInfo:(id)sender {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"If you become one of the most active 20% of Shnergle users in the last 30 days, you will appear on the podium below, unlocking more valuable promotions!" message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[[[UIAlertView alloc] initWithTitle:@"If you become one of the most active 20% of Shnergle users in the last 30 days, you will appear on the podium below, unlocking more valuable promotions!" message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show];
[Flurry logEvent:@"Tapped profile info"];
}

- (UIBarButtonItem *)createLeftBarButton:(NSString *)imageName actionSelector:(SEL)actionSelector {
Expand Down
3 changes: 3 additions & 0 deletions ShnergleApp/ShareViewController.m
Expand Up @@ -13,6 +13,7 @@
#import <Social/Social.h>
#import "CustomSlidingViewController.h"
#import "ThankYouViewController.h"
#import <FlurrySDK/Flurry.h>

@implementation ShareViewController

Expand Down Expand Up @@ -52,6 +53,7 @@ - (void)viewDidDisappear:(BOOL)animated {
}

- (void)uploadToServer {
[Flurry logEvent:@"Created post/share" withParameters:@{@"newPost": appDelegate.shnergleThis ? @"true" : @"false", @"facebook": self.fbSwitch.on ? @"true" : @"false", @"twitter": self.twSwitch.on ? @"true" : @"false", @"taggedPeople": [selectedFriends count] > 0 ? @"true" : @"false", @"text": (self.textFieldname.text && [self.textFieldname.text isEqualToString:@"Write something..."]) ? @"false" : @"true"}];
self.navigationItem.rightBarButtonItem.enabled = NO;
if (appDelegate.shnergleThis) {
[Request post:@"posts/set" params:@{@"venue_id": appDelegate.activeVenue[@"id"], @"caption": (self.textFieldname.text && [self.textFieldname.text isEqualToString:@"Write something..."]) ? @"" : self.textFieldname.text, @"image":self.image.image} callback:^(id response) {
Expand Down Expand Up @@ -217,6 +219,7 @@ - (IBAction)selectFriendsButtonAction:(id)sender {

- (void)facebookViewControllerCancelWasPressed:(id)sender {
[self dismissViewControllerAnimated:YES completion:nil];
[Flurry logEvent:@"Cancelled friend selection"];
}

- (void)facebookViewControllerDoneWasPressed:(id)sender {
Expand Down
2 changes: 2 additions & 0 deletions ShnergleApp/UIViewController+CheckIn.m
Expand Up @@ -9,6 +9,7 @@
#import "UIViewController+CheckIn.h"
#import <UIImage-Resize/UIImage+Resize.h>
#import "Request.h"
#import <FlurrySDK/Flurry.h>

@implementation UIViewController (CheckIn)

Expand Down Expand Up @@ -38,6 +39,7 @@ - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
}

- (IBAction)presentCheckInFlow:(id)sender {
[Flurry logEvent:@"Started checking in" withParameters:@{@"view": NSStringFromClass([self class])}];
appDelegate.shareVenue = NO;
appDelegate.shnergleThis = YES;
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
Expand Down

0 comments on commit 736b4bc

Please sign in to comment.