Commit 47a16429 authored by DanmeiChen's avatar DanmeiChen
Browse files

fix send chat message in background

parent 68023ef5
Pipeline #19739 failed with stage
in 2 minutes and 15 seconds
......@@ -59,8 +59,8 @@ import linphonesw
@objc func stopLinphoneCore() {
if (lc?.callsNb == 0) {
stopIterateTimer()
lc?.stop()
//stop iterate when core is off
lc?.stopAsync()
}
}
}
......@@ -587,6 +587,9 @@ static void linphone_iphone_global_state_changed(LinphoneCore *lc, LinphoneGloba
dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:state], @"state",
[NSString stringWithUTF8String:message ? message : ""], @"message", nil];
if (theLinphoneCore && linphone_core_get_global_state(theLinphoneCore) == LinphoneGlobalOff) {
[CoreManager.instance stopIterateTimer];
}
// dispatch the notification asynchronously
dispatch_async(dispatch_get_main_queue(), ^(void) {
if (theLinphoneCore && linphone_core_get_global_state(theLinphoneCore) != LinphoneGlobalOff)
......
......@@ -89,7 +89,7 @@ class NotificationService: UNNotificationServiceExtension {
if let message = message {
let msgData = parseMessage(message: message)
if let badge = updateBadge() as NSNumber? {
if !message.isUsingUserDefaults, let badge = updateBadge() as NSNumber? {
bestAttemptContent.badge = badge
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment