From 8c6e96eb80d5f46f8f218b6aaed67de9a02777b7 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Mon, 18 Nov 2013 12:12:08 +0100 Subject: [PATCH] Update the badge count to reflect ongoing calls. This is useful in the case an incoming call is received but Linphone is in the background. Also disable ringing once the application gets in the foreground. --- Classes/LinphoneAppDelegate.m | 3 +++ Classes/PhoneMainView.m | 1 + 2 files changed, 4 insertions(+) diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 2029ed228..b575da0b3 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -111,6 +111,9 @@ instance->currentCallContextBeforeGoingBackground.call = 0; } else { [[PhoneMainView instance ] displayIncomingCall:call]; + // in this case, the ringing sound comes from the notification. + // To stop it we have to do the iOS7 ring fix... + [self fixRing]; } } } diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index c43a87534..ee5dc90b5 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -345,6 +345,7 @@ static PhoneMainView* phoneMainViewInstance=nil; int count = 0; count += linphone_core_get_missed_calls_count([LinphoneManager getLc]); count += [ChatModel unreadMessages]; + count += linphone_core_get_calls_nb([LinphoneManager getLc]); [[UIApplication sharedApplication] setApplicationIconBadgeNumber:count]; }