File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -96,15 +96,26 @@ class NotificationService: UNNotificationServiceExtension {
9696 let chatNotification = chatHandler. handleNotification { chatContent in
9797 switch chatContent {
9898 case let . message( messageNotification) :
99- content
100- . title = ( messageNotification. message. author. name ?? " somebody " ) +
101- ( " on \( messageNotification. channel? . name ?? " a conversation with you " ) " )
99+ if messageNotification. type == . reminderDue {
100+ return contentHandler ( content)
101+ }
102+
103+ let authorName = messageNotification. message. author. name ?? " somebody "
104+ let channelName = messageNotification. channel? . name ?? " a conversation with you "
105+ content. title = " \( authorName) on \( channelName) a conversation with you "
102106 content. subtitle = " "
103107 content. body = messageNotification. message. text
104108 self . addMessageAttachments ( message: messageNotification. message, content: content) {
105109 contentHandler ( $0)
106110 }
107111 default :
112+ let streamPayload = content. userInfo [ " stream " ] as? [ String : String ]
113+ if let streamNotificationType = streamPayload ? [ " type " ] {
114+ if streamNotificationType == EventType . messageReminderDue. rawValue {
115+ contentHandler ( content)
116+ return
117+ }
118+ }
108119 content. title = " You received an update to one conversation "
109120 contentHandler ( content)
110121 }
You can’t perform that action at this time.
0 commit comments