Skip to content

Commit

Permalink
Removed unnecessary code for determining if user had clicked Skip Ver…
Browse files Browse the repository at this point in the history
…sion
  • Loading branch information
ArtSabintsev committed Jan 6, 2015
1 parent 23f849f commit 5c173d0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
6 changes: 3 additions & 3 deletions Harpy.podspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Pod::Spec.new do |s|
Pod::Spec.new do |s|
s.name = "Harpy"
s.version = "3.2.0"
s.version = "3.2.1"
s.summary = "Notify users that a new version of your iOS app is available, and prompt them with the AppStore link."
s.homepage = "https://github.com/ArtSabintsev/Harpy"
s.platform = :ios, '5.0'
s.source = { :git => "https://github.com/ArtSabintsev/Harpy.git", :tag => "3.2.0" }
s.source = { :git => "https://github.com/ArtSabintsev/Harpy.git", :tag => "3.2.1" }
s.source_files = 'Harpy/*.{h,m}'
s.resources = 'Harpy/Harpy.bundle'
s.requires_arc = true
Expand Down
8 changes: 1 addition & 7 deletions Harpy/Harpy.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#import "Harpy.h"

/// NSUserDefault macros to store user's preferences for HarpyAlertTypeSkip
#define HARPY_DEFAULT_SHOULD_SKIP_VERSION @"Harpy Should Skip Version Boolean"
#define HARPY_DEFAULT_SKIPPED_VERSION @"Harpy User Decided To Skip Version Update Boolean"
#define HARPY_DEFAULT_STORED_VERSION_CHECK_DATE @"Harpy Stored Date From Last Version Check"

Expand Down Expand Up @@ -217,12 +216,9 @@ - (void)checkIfAppStoreVersionIsNewestVersion:(NSString *)currentAppStoreVersion
- (void)showAlertIfCurrentAppStoreVersionNotSkipped:(NSString *)currentAppStoreVersion
{
// Check if user decided to skip this version in the past
BOOL shouldSkipVersionUpdate = [[NSUserDefaults standardUserDefaults] boolForKey:HARPY_DEFAULT_SHOULD_SKIP_VERSION];
NSString *storedSkippedVersion = [[NSUserDefaults standardUserDefaults] objectForKey:HARPY_DEFAULT_SKIPPED_VERSION];

if (!shouldSkipVersionUpdate) {
[self showAlertWithAppStoreVersion:currentAppStoreVersion];
} else if (shouldSkipVersionUpdate && ![storedSkippedVersion isEqualToString:currentAppStoreVersion]) {
if (![storedSkippedVersion isEqualToString:currentAppStoreVersion]) {
[self showAlertWithAppStoreVersion:currentAppStoreVersion];
} else {
// Don't show alert.
Expand Down Expand Up @@ -410,7 +406,6 @@ - (UIAlertAction *)skipAlertAction
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {
[[NSUserDefaults standardUserDefaults] setObject:_currentAppStoreVersion forKey:HARPY_DEFAULT_SKIPPED_VERSION];
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:HARPY_DEFAULT_SHOULD_SKIP_VERSION];
[[NSUserDefaults standardUserDefaults] synchronize];
if([self.delegate respondsToSelector:@selector(harpyUserDidSkipVersion)]){
[self.delegate harpyUserDidSkipVersion];
Expand Down Expand Up @@ -447,7 +442,6 @@ - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)butto
[self launchAppStore];
} else if (buttonIndex == 1) { // Launch App Store.app
[[NSUserDefaults standardUserDefaults] setObject:_currentAppStoreVersion forKey:HARPY_DEFAULT_SKIPPED_VERSION];
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:HARPY_DEFAULT_SHOULD_SKIP_VERSION];
[[NSUserDefaults standardUserDefaults] synchronize];
if([self.delegate respondsToSelector:@selector(harpyUserDidSkipVersion)]){
[self.delegate harpyUserDidSkipVersion];
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2012-2014 Arthur Ariel Sabintsev
Copyright (c) 2012-2015 Arthur Ariel Sabintsev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
This library is built to work with the [Semantic Versioning](http://semver.org/) system.

### Changelog
#### 3.2.0
- Replaced NSURLConnection code with NSURLSession code.
#### 3.2.1
- Removed unnecessary code for determining if user had clicked *Skip Version*

### Features
- Cocoapods Support
Expand Down

0 comments on commit 5c173d0

Please sign in to comment.