mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 02:58:07 +00:00
fix send chat message in background
This commit is contained in:
parent
68023ef595
commit
47a16429ae
3 changed files with 6 additions and 3 deletions
|
|
@ -59,8 +59,8 @@ import linphonesw
|
||||||
|
|
||||||
@objc func stopLinphoneCore() {
|
@objc func stopLinphoneCore() {
|
||||||
if (lc?.callsNb == 0) {
|
if (lc?.callsNb == 0) {
|
||||||
stopIterateTimer()
|
//stop iterate when core is off
|
||||||
lc?.stop()
|
lc?.stopAsync()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -587,6 +587,9 @@ static void linphone_iphone_global_state_changed(LinphoneCore *lc, LinphoneGloba
|
||||||
dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:state], @"state",
|
dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:state], @"state",
|
||||||
[NSString stringWithUTF8String:message ? message : ""], @"message", nil];
|
[NSString stringWithUTF8String:message ? message : ""], @"message", nil];
|
||||||
|
|
||||||
|
if (theLinphoneCore && linphone_core_get_global_state(theLinphoneCore) == LinphoneGlobalOff) {
|
||||||
|
[CoreManager.instance stopIterateTimer];
|
||||||
|
}
|
||||||
// dispatch the notification asynchronously
|
// dispatch the notification asynchronously
|
||||||
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
dispatch_async(dispatch_get_main_queue(), ^(void) {
|
||||||
if (theLinphoneCore && linphone_core_get_global_state(theLinphoneCore) != LinphoneGlobalOff)
|
if (theLinphoneCore && linphone_core_get_global_state(theLinphoneCore) != LinphoneGlobalOff)
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ class NotificationService: UNNotificationServiceExtension {
|
||||||
if let message = message {
|
if let message = message {
|
||||||
let msgData = parseMessage(message: message)
|
let msgData = parseMessage(message: message)
|
||||||
|
|
||||||
if let badge = updateBadge() as NSNumber? {
|
if !message.isUsingUserDefaults, let badge = updateBadge() as NSNumber? {
|
||||||
bestAttemptContent.badge = badge
|
bestAttemptContent.badge = badge
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue