diff --git a/OdessaMacGUIApp/OdessaMacGUIApp.xcodeproj/project.pbxproj b/OdessaMacGUIApp/OdessaMacGUIApp.xcodeproj/project.pbxproj index 8675772..7e16b0b 100644 --- a/OdessaMacGUIApp/OdessaMacGUIApp.xcodeproj/project.pbxproj +++ b/OdessaMacGUIApp/OdessaMacGUIApp.xcodeproj/project.pbxproj @@ -107,10 +107,6 @@ CE4E8BC0162776BA00C6054E /* UpdateCheckerWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = CE701E6614A00B0400C888D1 /* UpdateCheckerWorker.h */; }; CE4E8BC1162776CE00C6054E /* UpdateChecker.m in Sources */ = {isa = PBXBuildFile; fileRef = CE701E6514A00B0400C888D1 /* UpdateChecker.m */; }; CE4E8BC2162776CE00C6054E /* UpdateCheckerWorker.m in Sources */ = {isa = PBXBuildFile; fileRef = CE701E6714A00B0400C888D1 /* UpdateCheckerWorker.m */; }; - CE4E8BC516278BD900C6054E /* AppStoreRating.h in Headers */ = {isa = PBXBuildFile; fileRef = CE4E8BC316278BD900C6054E /* AppStoreRating.h */; }; - CE4E8BC616278BD900C6054E /* AppStoreRating.h in Headers */ = {isa = PBXBuildFile; fileRef = CE4E8BC316278BD900C6054E /* AppStoreRating.h */; }; - CE4E8BC816278BD900C6054E /* AppStoreRating.m in Sources */ = {isa = PBXBuildFile; fileRef = CE4E8BC416278BD900C6054E /* AppStoreRating.m */; }; - CE4E8BC916278BD900C6054E /* AppStoreRating.m in Sources */ = {isa = PBXBuildFile; fileRef = CE4E8BC416278BD900C6054E /* AppStoreRating.m */; }; CE4E8BD0162CC55700C6054E /* ffmpeg.entitlements in Resources */ = {isa = PBXBuildFile; fileRef = CE4E8BCE162CC55700C6054E /* ffmpeg.entitlements */; }; CE4E8BD1162CC55700C6054E /* ffmpeg.entitlements in Resources */ = {isa = PBXBuildFile; fileRef = CE4E8BCE162CC55700C6054E /* ffmpeg.entitlements */; }; CE4E8BD5162CC8BD00C6054E /* mediainfo.entitlements in Resources */ = {isa = PBXBuildFile; fileRef = CE4E8BD3162CC8BD00C6054E /* mediainfo.entitlements */; }; @@ -997,8 +993,6 @@ CE4D99691607E17E00739B1E /* InputFilesCollectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InputFilesCollectionView.m; sourceTree = ""; }; CE4D997D1607EE2F00739B1E /* SmallDropHereDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmallDropHereDelegate.h; sourceTree = ""; }; CE4D99C4160908B900739B1E /* PhFacebook.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = PhFacebook.xcodeproj; sourceTree = ""; }; - CE4E8BC316278BD900C6054E /* AppStoreRating.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppStoreRating.h; sourceTree = ""; }; - CE4E8BC416278BD900C6054E /* AppStoreRating.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppStoreRating.m; sourceTree = ""; }; CE4E8BCE162CC55700C6054E /* ffmpeg.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = ffmpeg.entitlements; sourceTree = ""; }; CE4E8BD3162CC8BD00C6054E /* mediainfo.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = mediainfo.entitlements; sourceTree = ""; }; CE4E8BD9162CCE1C00C6054E /* codesign-frameworks.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "codesign-frameworks.sh"; sourceTree = ""; }; @@ -1760,8 +1754,6 @@ CE571EFA160996DF00491E67 /* JFUrlUtil.m */, CE9FD92615EEE02F00D458BC /* NSURL+Helpers.h */, CE9FD92715EEE03300D458BC /* NSURL+Helpers.m */, - CE4E8BC316278BD900C6054E /* AppStoreRating.h */, - CE4E8BC416278BD900C6054E /* AppStoreRating.m */, ); path = OtherHelpers; sourceTree = ""; @@ -2385,7 +2377,6 @@ CEFCE019161501FC003EA03D /* PublishButtonDelegate.h in Headers */, CEFCE0BF161A641C003EA03D /* ExportWorker.h in Headers */, CEFCE0C6161A64C2003EA03D /* FinalCutProXExportWorker.h in Headers */, - CE4E8BC516278BD900C6054E /* AppStoreRating.h in Headers */, CE9B849B168E4ABC007AFBF3 /* TutorialBubbleController.h in Headers */, CED277CB1691019400FC84A7 /* TutorialHelper.h in Headers */, CED277D61693D5C500FC84A7 /* ShareButtonTutorialDelegate.h in Headers */, @@ -2538,7 +2529,6 @@ CEFCE01A161501FC003EA03D /* PublishButtonDelegate.h in Headers */, CEFCE0C0161A641C003EA03D /* ExportWorker.h in Headers */, CEFCE0C7161A64C2003EA03D /* FinalCutProXExportWorker.h in Headers */, - CE4E8BC616278BD900C6054E /* AppStoreRating.h in Headers */, CE9B849C168E4ABC007AFBF3 /* TutorialBubbleController.h in Headers */, CED277CC1691019400FC84A7 /* TutorialHelper.h in Headers */, CED277D71693D5C500FC84A7 /* ShareButtonTutorialDelegate.h in Headers */, @@ -3168,7 +3158,6 @@ CEFCE01716150120003EA03D /* PublishButtonView.m in Sources */, CEFCE0C3161A641C003EA03D /* ExportWorker.m in Sources */, CEFCE0CA161A64C2003EA03D /* FinalCutProXExportWorker.m in Sources */, - CE4E8BC916278BD900C6054E /* AppStoreRating.m in Sources */, CE9B849F168E4ABC007AFBF3 /* TutorialBubbleController.m in Sources */, CED277CF1691019400FC84A7 /* TutorialHelper.m in Sources */, CEC0D9961698AA1200BCCD6D /* TutorialEscapeHatchViewController.m in Sources */, @@ -3266,7 +3255,6 @@ CEFCE01616150120003EA03D /* PublishButtonView.m in Sources */, CEFCE0C2161A641C003EA03D /* ExportWorker.m in Sources */, CEFCE0C9161A64C2003EA03D /* FinalCutProXExportWorker.m in Sources */, - CE4E8BC816278BD900C6054E /* AppStoreRating.m in Sources */, CE9B849E168E4ABC007AFBF3 /* TutorialBubbleController.m in Sources */, CED277CE1691019400FC84A7 /* TutorialHelper.m in Sources */, CEC0D9951698AA1200BCCD6D /* TutorialEscapeHatchViewController.m in Sources */, diff --git a/OdessaMacGUIApp/Source/OtherHelpers/AppStoreRating.h b/OdessaMacGUIApp/Source/OtherHelpers/AppStoreRating.h deleted file mode 100644 index 1af920e..0000000 --- a/OdessaMacGUIApp/Source/OtherHelpers/AppStoreRating.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// AppStoreRating.h -// OdessaMacGUIApp -// -// Created by Noah Spitzer-Williams on 10/11/12. -// Copyright (c) 2012 Authentically Digital LLC. All rights reserved. -// - -#import -#import "NSAlert+SynchronousSheet.h" - -@interface AppStoreRating : NSObject - -+ (void)handleAppStoreRatingPrompt:(NSWindow*)window; - -@end diff --git a/OdessaMacGUIApp/Source/OtherHelpers/AppStoreRating.m b/OdessaMacGUIApp/Source/OtherHelpers/AppStoreRating.m deleted file mode 100644 index 09a7c79..0000000 --- a/OdessaMacGUIApp/Source/OtherHelpers/AppStoreRating.m +++ /dev/null @@ -1,107 +0,0 @@ -// -// AppStoreRating.m -// OdessaMacGUIApp -// -// Created by Noah Spitzer-Williams on 10/11/12. -// Copyright (c) 2012 Authentically Digital LLC. All rights reserved. -// - -#import "AppStoreRating.h" - -@implementation AppStoreRating - -+ (void)handleAppStoreRatingPrompt:(NSWindow*)window -{ - // see if they upgraded and we should reset their answer from before - NSUserDefaults* standardUserDefaults = [NSUserDefaults standardUserDefaults]; - if (standardUserDefaults) - { - NSDictionary* infoDict = [[NSBundle mainBundle] infoDictionary]; - NSString* version = [infoDict objectForKey:@"CFBundleShortVersionString"]; - - if ([[standardUserDefaults stringForKey:@"AppStoreReviewVersionNumber"] isEqualToString:version] == NO) // they upgraded to new version - { - [standardUserDefaults setBool:NO forKey:@"HasAddressedAppStoreReviewPrompt"]; - [standardUserDefaults setObject:version forKey:@"AppStoreReviewVersionNumber"]; - [standardUserDefaults synchronize]; - } - } - - - if ([AppStoreRating isTimeToPrompt]) - { - [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(promptForRating:) userInfo:window repeats:NO]; - - } -} - -+ (BOOL)isTimeToPrompt -{ - - NSUserDefaults* standardUserDefaults = [NSUserDefaults standardUserDefaults]; - if (standardUserDefaults) - { - NSString* todayDate = [NSDateFormatter localizedStringFromDate:[NSDate date] dateStyle:NSDateFormatterShortStyle timeStyle:NSDateFormatterNoStyle]; - NSInteger totalLoads = [standardUserDefaults integerForKey:@"TotalLoads"]; - NSString* lastPromptDate = [standardUserDefaults stringForKey:@"LastAppStoreReviewPromptDate"]; - BOOL hasAddressedAppStoreReviewPrompt = [standardUserDefaults boolForKey:@"HasAddressedAppStoreReviewPrompt"]; - if (totalLoads >= 3 && !hasAddressedAppStoreReviewPrompt && ![todayDate isEqualToString:lastPromptDate]) - { // only prompt if they've loaded it 3 times and we havent prompted them yet today - return YES; - } - } - - return NO; -} - -+ (void)promptForRating:(NSTimer*)timer -{ -#ifndef APPSTORE // only prompt if app store build - return; -#endif - - NSWindow* window = [timer userInfo]; - - - NSString* msg = @"Do you mind quickly rating Highlight Hunter in the App Store?\n\nRatings are reset with every new version."; - NSAlert *alert = [[NSAlert alloc] init]; - [alert addButtonWithTitle:@"Rate now"]; - [alert addButtonWithTitle:@"Not now"]; - [alert addButtonWithTitle:@"No thanks"]; - [alert setMessageText:@"Rate us in the App Store?"]; - [alert setInformativeText:msg]; - [alert setAlertStyle:NSInformationalAlertStyle]; - NSInteger returnCode = [alert runModalSheetForWindow:window]; - - NSUserDefaults* standardUserDefaults = [NSUserDefaults standardUserDefaults]; - - - if (returnCode == NSAlertFirstButtonReturn) - { // rate now - #if APPSTORE_FREE - NSURL* url = [NSURL URLWithString:@"macappstore://itunes.apple.com/app/id521035831?mt=12"]; - #else - NSURL* url = [NSURL URLWithString:@"macappstore://itunes.apple.com/app/id521180800?mt=12"]; - #endif - - [[NSWorkspace sharedWorkspace] openURL:url]; - - if (standardUserDefaults) - [standardUserDefaults setBool:YES forKey:@"HasAddressedAppStoreReviewPrompt"]; - - } - else if (returnCode == NSAlertSecondButtonReturn) - { // not now - NSString* todayDate = [NSDateFormatter localizedStringFromDate:[NSDate date] dateStyle:NSDateFormatterShortStyle timeStyle:NSDateFormatterNoStyle]; - [standardUserDefaults setValue:todayDate forKey:@"LastAppStoreReviewPromptDate"]; - } - else if (returnCode == NSAlertThirdButtonReturn) - { // no thanks - if (standardUserDefaults) - [standardUserDefaults setBool:YES forKey:@"HasAddressedAppStoreReviewPrompt"]; - } - - [standardUserDefaults synchronize]; -} - -@end diff --git a/OdessaMacGUIApp/Source/ReviewHighlights/HighlightCollectionViewItem/PublishStatus/PublishStatusViewItem.h b/OdessaMacGUIApp/Source/ReviewHighlights/HighlightCollectionViewItem/PublishStatus/PublishStatusViewItem.h index f253c9b..28ff147 100644 --- a/OdessaMacGUIApp/Source/ReviewHighlights/HighlightCollectionViewItem/PublishStatus/PublishStatusViewItem.h +++ b/OdessaMacGUIApp/Source/ReviewHighlights/HighlightCollectionViewItem/PublishStatus/PublishStatusViewItem.h @@ -15,7 +15,6 @@ #import "HighlightDelegate.h" #import "IconButton.h" #import "FacebookShareWorker.h" -#import "AppStoreRating.h" @interface PublishStatusViewItem : AMCollectionViewItem { } diff --git a/OdessaMacGUIApp/Source/ReviewHighlights/HighlightCollectionViewItem/PublishStatus/PublishStatusViewItem.m b/OdessaMacGUIApp/Source/ReviewHighlights/HighlightCollectionViewItem/PublishStatus/PublishStatusViewItem.m index 47de271..87ae155 100644 --- a/OdessaMacGUIApp/Source/ReviewHighlights/HighlightCollectionViewItem/PublishStatus/PublishStatusViewItem.m +++ b/OdessaMacGUIApp/Source/ReviewHighlights/HighlightCollectionViewItem/PublishStatus/PublishStatusViewItem.m @@ -194,9 +194,6 @@ - (IBAction)buttonPressed:(id)sender { [self.publishWorker viewResult]; - [AppStoreRating handleAppStoreRatingPrompt:self.window]; - - } } diff --git a/OdessaMacGUIApp/Source/ReviewHighlights/HighlightDetails/PublishButton/PublishButtonViewController.h b/OdessaMacGUIApp/Source/ReviewHighlights/HighlightDetails/PublishButton/PublishButtonViewController.h index 39f2a4e..5c107ed 100644 --- a/OdessaMacGUIApp/Source/ReviewHighlights/HighlightDetails/PublishButton/PublishButtonViewController.h +++ b/OdessaMacGUIApp/Source/ReviewHighlights/HighlightDetails/PublishButton/PublishButtonViewController.h @@ -20,7 +20,6 @@ #import "PublishButtonDelegate.h" #import "PublishButtonView.h" #import "HoverButton.h" -#import "AppStoreRating.h" #import "TutorialHelper.h" #import "ShareButtonTutorialDelegate.h" diff --git a/OdessaMacGUIApp/Source/ReviewHighlights/HighlightDetails/PublishButton/PublishButtonViewController.m b/OdessaMacGUIApp/Source/ReviewHighlights/HighlightDetails/PublishButton/PublishButtonViewController.m index fd72dc8..ecafdef 100644 --- a/OdessaMacGUIApp/Source/ReviewHighlights/HighlightDetails/PublishButton/PublishButtonViewController.m +++ b/OdessaMacGUIApp/Source/ReviewHighlights/HighlightDetails/PublishButton/PublishButtonViewController.m @@ -122,8 +122,6 @@ - (IBAction)takeAction:(id)sender { [self.publishWorker viewResult]; - [AppStoreRating handleAppStoreRatingPrompt:self.window]; - break; }