Skip to content

Commit

Permalink
adds usage of string constants for parse realtime notification regist…
Browse files Browse the repository at this point in the history
…ration
  • Loading branch information
Frank Gregor committed Apr 10, 2019
1 parent 2650df8 commit 4b45c02
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 2 additions & 3 deletions App/Podlive/Application/CCNApplicationDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
[self populateMainWindow];

[CCNUserManager.sharedManager startListening];
[PFPush subscribeToChannelInBackground:@"realtimeNotifications"];
[PFPush subscribeToChannelInBackground:CCNParseRealtimeNotifications];
}

- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
Expand All @@ -63,8 +63,7 @@ - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sende
}

- (void)applicationWillTerminate:(NSNotification *)aNotification {
// Insert code here to tear down your application
[PFPush unsubscribeFromChannelInBackground:@"realtimeNotifications"];
[PFPush unsubscribeFromChannelInBackground:CCNParseRealtimeNotifications];

let isAnonynousUser = [PFAnonymousUtils isLinkedWithUser:PFUser.currentUser];
if (isAnonynousUser) {
Expand Down
5 changes: 5 additions & 0 deletions App/Podlive/Application/Constants/CCNConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ FOUNDATION_EXPORT const CGFloat kInnerEdgeDoubleMargin;

// Notifications
FOUNDATION_EXPORT NSString *const CCNUserUpdatedNotification;
FOUNDATION_EXPORT NSString *const CCNRealtimeNotifications;
FOUNDATION_EXPORT NSString *const CCNPushNotificationChannelStateUpdated;
FOUNDATION_EXPORT NSString *const CCNChannelSubscriptionUpdatedNotification;
FOUNDATION_EXPORT NSString *const CCNPushNotificationChannelListenerCountUpdated;
Expand All @@ -39,6 +40,10 @@ FOUNDATION_EXPORT NSString *const CCNSignUpFailureNotification;
FOUNDATION_EXPORT NSString *const CCNLogOutNotification;


// Parse Notifications
FOUNDATION_EXPORT NSString *const CCNParseRealtimeNotifications;


// NSUserDefaults
FOUNDATION_EXPORT NSString *const CCNCurrentAppearance;

Expand Down
4 changes: 4 additions & 0 deletions App/Podlive/Application/Constants/CCNConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ + (NSString *)valueForBackendType:(CCNBackendType)backendType withKey:(NSString
NSString *const CCNLogOutNotification = @"CCNLogOutNotification";


// Parse Notifications
NSString *const CCNParseRealtimeNotifications = @"realtimeNotifications";


// NSUserDefaults
NSString *const CCNCurrentAppearance = @"CCNCurrentAppearance";

Expand Down

0 comments on commit 4b45c02

Please sign in to comment.