Temporary fix for notif song of chat room invite and chat room invite

msg
This commit is contained in:
Paul Cartier 2020-04-01 14:22:54 +02:00
parent da0dcd030b
commit 4d05de7bc9

View file

@ -68,6 +68,7 @@ class NotificationService: UNNotificationServiceExtension {
bestAttemptContent.body = chatRoom.subject
}
bestAttemptContent.sound = UNNotificationSound(named: UNNotificationSoundName("msg.caf")) // TODO : temporary fix, to be removed after flexisip release
contentHandler(bestAttemptContent)
return
}
@ -118,8 +119,15 @@ class NotificationService: UNNotificationServiceExtension {
if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent {
NSLog("[msgNotificationService] serviceExtensionTimeWillExpire")
bestAttemptContent.categoryIdentifier = "app_active"
bestAttemptContent.title = NSLocalizedString("Message received", comment: "")
bestAttemptContent.body = NSLocalizedString("You have received a message.", comment: "")
if let chatRoomInviteAddr = bestAttemptContent.userInfo["chat-room-addr"] as? String, !chatRoomInviteAddr.isEmpty {
bestAttemptContent.title = NSLocalizedString("You have been added to a chat room", comment: "")
bestAttemptContent.body = ""
bestAttemptContent.sound = UNNotificationSound(named: UNNotificationSoundName("msg.caf")) // TODO : temporary fix, to be removed after flexisip release
} else {
bestAttemptContent.title = NSLocalizedString("Message received", comment: "")
bestAttemptContent.body = NSLocalizedString("You have received a message.", comment: "")
}
contentHandler(bestAttemptContent)
}
}