Skip to content

Commit e5a70c0

Browse files
committed
feat: parse from caller ID for missed call notification title
1 parent ae5c978 commit e5a70c0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ios/Classes/SwiftTwilioVoicePlugin.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -673,14 +673,18 @@ public class SwiftTwilioVoicePlugin: NSObject, FlutterPlugin, FlutterStreamHand
673673
let content = UNMutableNotificationContent()
674674
var userName:String?
675675
if var from = from{
676-
from = from.replacingOccurrences(of: "client:", with: "")
676+
if(from.contains("client:")) {
677+
from = from.replacingOccurrences(of: "client:", with: "")
678+
userName = self.clients[from];
679+
} else {
680+
userName = from
681+
}
677682
content.userInfo = ["type":"twilio-missed-call", "From":from]
678683
if let to = to{
679684
content.userInfo["To"] = to
680685
}
681-
userName = self.clients[from]
682686
}
683-
687+
684688
let title = userName ?? self.clients["defaultCaller"] ?? self.defaultCaller
685689
content.title = title
686690
content.body = NSLocalizedString("notification_missed_call_body", comment: "")

0 commit comments

Comments
 (0)