show incoming call notification

This commit is contained in:
ryanzhao 2021-10-11 15:23:19 +11:00
parent a1f8e16eb3
commit 57a04f4ff5
1 changed files with 7 additions and 0 deletions

View File

@ -87,6 +87,13 @@ public final class NotificationServiceExtension : UNNotificationServiceExtension
case .new(_, let name, _, _, _, _): snippet = "\(senderDisplayName) added you to \(name)"
default: return self.completeSilenty()
}
case let callMessage as CallMessage:
MessageReceiver.handleCallMessage(callMessage, using: transaction)
notificationContent.userInfo = userInfo
notificationContent.badge = 1
notificationContent.title = "Session"
notificationContent.body = "\(senderDisplayName) is calling..."
return self.handleSuccess(for: notificationContent)
default: return self.completeSilenty()
}
if (senderPublicKey == userPublicKey) {