Add support for MWI (voicemail) push notifications

This commit is contained in:
Benoit Martins 2025-12-18 16:57:35 +01:00
parent 4c45a9bb1e
commit 1dbbe6a53d
4 changed files with 12 additions and 1 deletions

View file

@ -2,6 +2,6 @@ import Foundation
public enum AppGitInfo {
public static let branch = "master"
public static let commit = "4feae7fcc"
public static let commit = "4c45a9bb1"
public static let tag = "6.1.0-alpha"
}

View file

@ -537,6 +537,8 @@
"uri_handler_config_success_toast" = "Configuration successfully applied";
"username" = "Username";
"username_error" = "Username error";
"Voicemail" = "Voicemail";
"New message" = "New message";
"web_platform_forgotten_password_url" = "https://subscribe.linphone.org/";
"web_platform_register_email_url" = "https://subscribe.linphone.org/register/email";
"website_contact_url" = "https://linphone.org/contact";

View file

@ -534,6 +534,8 @@
"uri_handler_config_success_toast" = "Configuration appliquée avec succè";
"username" = "Nom dutilisateur";
"username_error" = "Erreur dans le nom d'utilisateur";
"Voicemail" = "Messagerie vocale";
"New message" = "Nouveau message";
"web_platform_forgotten_password_url" = "https://subscribe.linphone.org/";
"web_platform_register_email_url" = "https://subscribe.linphone.org/register/email";
"website_contact_url" = "https://linphone.org/contact";

View file

@ -97,6 +97,13 @@ class NotificationService: UNNotificationServiceExtension {
*/
if let bestAttemptContent = bestAttemptContent {
if let aps = request.content.userInfo["aps"] as? [String: Any], let alert = aps["alert"] as? [String: Any], let locKey = alert["loc-key"] as? String, locKey == "MWI_NOTIFY_STR" {
bestAttemptContent.title = String(localized: "Voicemail")
bestAttemptContent.body = String(localized: "New message")
contentHandler(bestAttemptContent)
return
}
createCore()
if !lc!.config!.getBool(section: "app", key: "disable_chat_feature", defaultValue: false) {
Log.info("received push payload : \(bestAttemptContent.userInfo.debugDescription)")