Permalink
Browse files

Fixed bug where notifications would continue to be displayed after be…

…ing viewed or ignored.
  • Loading branch information...
1 parent 3c89206 commit aa11c85fff9d73804c91f6abc4fb0264ec9ae2db @nicklockwood committed with Nick Lockwood Jun 28, 2011
Showing with 7 additions and 16 deletions.
  1. +1 −1 LICENCE.txt
  2. +4 −0 RELEASE NOTES.txt
  3. +2 −15 iNotify/iNotify.m
View
@@ -1,5 +1,5 @@
iNotify
-version 1.3.1, March 24th, 2011
+version 1.3.2, June 28th, 2011
Copyright (C) 2011 Charcoal Design
View
@@ -1,3 +1,7 @@
+Version 1.3.2
+
+- Fixed bug whereby ignored or viewed notifications would continue to appear.
+
Version 1.3.1
- Fixed crash on iOS versions before 4.0 when downloading notifications.
View
@@ -193,9 +193,9 @@ - (void)dealloc
}
#pragma mark -
-#pragma mark Methods
+#pragma mark Private methods
-- (void)setnotificationsDict:(NSDictionary *)notifications
+- (void)setNotificationsDict:(NSDictionary *)notifications
{
if (notifications != notificationsDict)
{
@@ -326,26 +326,19 @@ - (void)downloadedNotificationsData
- (BOOL)shouldCheckForNotifications
{
- //check if disabled
if (disabled)
{
return NO;
}
-
- //debug mode?
else if (debug)
{
//continue
}
-
- //check if first launch
else if (!showOnFirstLaunch && [[NSUserDefaults standardUserDefaults] objectForKey:iNotifyIgnoredNotificationsKey] == nil)
{
self.ignoredNotifications = [NSArray array];
return NO;
}
-
- //check if within the reminder period
else if (self.lastReminded != nil)
{
//reminder takes priority over check period
@@ -354,20 +347,14 @@ - (BOOL)shouldCheckForNotifications
return NO;
}
}
-
- //check if within the check period
else if (self.lastChecked != nil && [[NSDate date] timeIntervalSinceDate:self.lastChecked] < checkPeriod * SECONDS_IN_A_DAY)
{
return NO;
}
-
- //confirm with delegate
if ([(NSObject *)delegate respondsToSelector:@selector(iNotifyShouldCheckForNotifications)])
{
return [delegate iNotifyShouldCheckForNotifications];
}
-
- //perform the check
return YES;
}

0 comments on commit aa11c85

Please sign in to comment.