diff --git a/App/Podlive/Application/CCNApplicationDelegate.m b/App/Podlive/Application/CCNApplicationDelegate.m index 1067e8f..ce5a2d2 100644 --- a/App/Podlive/Application/CCNApplicationDelegate.m +++ b/App/Podlive/Application/CCNApplicationDelegate.m @@ -45,7 +45,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { [self populateMainWindow]; [CCNUserManager.sharedManager startListening]; - [PFPush subscribeToChannelInBackground:@"realtimeNotifications"]; + [PFPush subscribeToChannelInBackground:CCNParseRealtimeNotifications]; } - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender { @@ -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) { diff --git a/App/Podlive/Application/Constants/CCNConstants.h b/App/Podlive/Application/Constants/CCNConstants.h index 4307f50..364224d 100644 --- a/App/Podlive/Application/Constants/CCNConstants.h +++ b/App/Podlive/Application/Constants/CCNConstants.h @@ -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; @@ -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; diff --git a/App/Podlive/Application/Constants/CCNConstants.m b/App/Podlive/Application/Constants/CCNConstants.m index e1acf8f..9793789 100644 --- a/App/Podlive/Application/Constants/CCNConstants.m +++ b/App/Podlive/Application/Constants/CCNConstants.m @@ -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";