From 9b1695f28c89746aba8de43e925d96a15acacdef Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Sat, 1 Jul 2017 10:29:15 -0700 Subject: [PATCH 1/2] Play audible alert for missed call // FREEBIE --- Signal/src/environment/NotificationsManager.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Signal/src/environment/NotificationsManager.m b/Signal/src/environment/NotificationsManager.m index 13fd350b7..fafc5da35 100644 --- a/Signal/src/environment/NotificationsManager.m +++ b/Signal/src/environment/NotificationsManager.m @@ -96,6 +96,9 @@ PushManagerUserInfoKeysCallBackSignalRecipientId : call.remotePhoneNumber }; + if ([self shouldPlaySoundForNotification]) { + notification.soundName = @"NewMessage.aifc"; + } NSString *alertMessage; switch (self.notificationPreviewType) { @@ -132,6 +135,9 @@ PushManagerUserInfoKeysCallBackSignalRecipientId : call.remotePhoneNumber, Signal_Thread_UserInfo_Key : thread.uniqueId }; + if ([self shouldPlaySoundForNotification]) { + notification.soundName = @"NewMessage.aifc"; + } NSString *alertMessage; switch (self.notificationPreviewType) { @@ -169,6 +175,9 @@ PushManagerUserInfoKeysCallBackSignalRecipientId : call.remotePhoneNumber, Signal_Thread_UserInfo_Key : thread.uniqueId }; + if ([self shouldPlaySoundForNotification]) { + notification.soundName = @"NewMessage.aifc"; + } NSString *alertMessage; switch (self.notificationPreviewType) { From c1881c02c82bd2b0f2d8d45029c5c73739435c27 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Wed, 5 Jul 2017 11:45:31 -0500 Subject: [PATCH 2/2] constantize file name per CR // FREEBIE --- Signal/src/environment/NotificationsManager.m | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Signal/src/environment/NotificationsManager.m b/Signal/src/environment/NotificationsManager.m index fafc5da35..b40b607fd 100644 --- a/Signal/src/environment/NotificationsManager.m +++ b/Signal/src/environment/NotificationsManager.m @@ -16,6 +16,8 @@ #import #import +NSString *const kNotificationsManagerNewMesssageSoundName = @"NewMessage.aifc"; + @interface NotificationsManager () @property (nonatomic) SystemSoundID newMessageSound; @@ -97,7 +99,7 @@ }; if ([self shouldPlaySoundForNotification]) { - notification.soundName = @"NewMessage.aifc"; + notification.soundName = kNotificationsManagerNewMesssageSoundName; } NSString *alertMessage; @@ -136,7 +138,7 @@ Signal_Thread_UserInfo_Key : thread.uniqueId }; if ([self shouldPlaySoundForNotification]) { - notification.soundName = @"NewMessage.aifc"; + notification.soundName = kNotificationsManagerNewMesssageSoundName; } NSString *alertMessage; @@ -176,7 +178,7 @@ Signal_Thread_UserInfo_Key : thread.uniqueId }; if ([self shouldPlaySoundForNotification]) { - notification.soundName = @"NewMessage.aifc"; + notification.soundName = kNotificationsManagerNewMesssageSoundName; } NSString *alertMessage; @@ -219,7 +221,7 @@ UILocalNotification *notification = [[UILocalNotification alloc] init]; notification.userInfo = @{Signal_Thread_UserInfo_Key : thread.uniqueId}; if (shouldPlaySound) { - notification.soundName = @"NewMessage.aifc"; + notification.soundName = kNotificationsManagerNewMesssageSoundName; } NSString *alertBodyString = @""; @@ -268,7 +270,7 @@ if ([UIApplication sharedApplication].applicationState != UIApplicationStateActive && messageDescription) { UILocalNotification *notification = [[UILocalNotification alloc] init]; if (shouldPlaySound) { - notification.soundName = @"NewMessage.aifc"; + notification.soundName = kNotificationsManagerNewMesssageSoundName; } switch (self.notificationPreviewType) {