diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 4f290fd18..d2c107519 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -2208,8 +2208,8 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) { [[UIApplication sharedApplication] endBackgroundTask:pushBgTaskCall]; pushBgTaskCall = 0; }]; - LOGI(@"Call long running task started for call-id [%@], remaining [%g s] because a push has been received", - callId, [[UIApplication sharedApplication] backgroundTimeRemaining]); + LOGI(@"Call long running task started for call-id [%@], remaining [%@ s] because a push has been received", + callId, [LinphoneUtils intervalToString:[[UIApplication sharedApplication] backgroundTimeRemaining]]); } else if ([loc_key isEqualToString:@"IC_SIL"]) { [[UIApplication sharedApplication] endBackgroundTask:pushBgTaskRefer]; pushBgTaskRefer = 0; @@ -2225,8 +2225,8 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) { [[UIApplication sharedApplication] endBackgroundTask:pushBgTaskRefer]; pushBgTaskRefer = 0; }]; - LOGI(@"Refer long running task started for call-id [%@], remaining [%g s] because a push has been received", - callId, [[UIApplication sharedApplication] backgroundTimeRemaining]); + LOGI(@"Refer long running task started for call-id [%@], remaining [%@ s] because a push has been received", + callId, [LinphoneUtils intervalToString:[[UIApplication sharedApplication] backgroundTimeRemaining]]); } } diff --git a/Classes/Utils/Utils.m b/Classes/Utils/Utils.m index 50399ea83..e7061da59 100644 --- a/Classes/Utils/Utils.m +++ b/Classes/Utils/Utils.m @@ -76,6 +76,8 @@ + (NSString *) intervalToString:(NSTimeInterval)interval { NSDateComponentsFormatter *formatter = [[NSDateComponentsFormatter alloc] init]; formatter.allowedUnits = NSCalendarUnitSecond; + formatter.unitsStyle = NSDateComponentsFormatterUnitsStyleAbbreviated; + formatter.zeroFormattingBehavior = NSDateComponentsFormatterZeroFormattingBehaviorDropAll; return [formatter stringFromTimeInterval:interval]; }