Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
[#449] notification center is always available
Browse files Browse the repository at this point in the history
  • Loading branch information
mackuba committed Mar 29, 2015
1 parent 5c6f2d2 commit 1a74107
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
3 changes: 0 additions & 3 deletions Hive/Backend/HINotificationService.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
*/
@interface HINotificationService : NSObject

/* Test in notifications are supported on the current OS version. */
@property (nonatomic, assign, readonly) BOOL notificationsAvailable;

/* Enables or disables notifications. */
@property (nonatomic, assign) BOOL enabled;

Expand Down
6 changes: 1 addition & 5 deletions Hive/Backend/HINotificationService.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,13 @@ + (HINotificationService *)sharedService {
return sharedService;
}

- (BOOL)notificationsAvailable {
return NSClassFromString(@"NSUserNotificationCenter") != nil;
}

- (void)setEnabled:(BOOL)enabled {
enabled = enabled && self.notificationsAvailable;
if (!_enabled && enabled) {
[self enable];
} else if (_enabled && !enabled) {
[self disable];
}

_enabled = enabled;
}

Expand Down

0 comments on commit 1a74107

Please sign in to comment.