fix send chat message in background

This commit is contained in:
Danmei Chen 2020-09-18 11:17:39 +02:00
parent 68023ef595
commit 47a16429ae
3 changed files with 6 additions and 3 deletions

View file

@ -59,8 +59,8 @@ import linphonesw
@objc func stopLinphoneCore() {
if (lc?.callsNb == 0) {
stopIterateTimer()
lc?.stop()
//stop iterate when core is off
lc?.stopAsync()
}
}
}

View file

@ -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)

View file

@ -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
}