repair flexisip pusher notification display

This commit is contained in:
Benjamin Reis 2018-03-12 12:01:59 +01:00
parent d0a7f4ede1
commit 392f991fae
2 changed files with 13 additions and 1 deletions

View file

@ -436,7 +436,7 @@
return;
}
NSString *loc_key = [aps objectForKey:@"loc-key"];
NSString *loc_key = [aps objectForKey:@"loc-key"] ?: [[aps objectForKey:@"alert"] objectForKey:@"loc-key"];
NSString *callId = [aps objectForKey:@"call-id"] ?: @"";
if (!loc_key) {
LOGE(@"Notification [%p] has no loc_key, it's impossible to process it.", userInfo);
@ -486,6 +486,12 @@
}
- (BOOL)addLongTaskIDforCallID:(NSString *)callId {
if (!callId)
return FALSE;
if ([callId isEqualToString:@""])
return FALSE;
NSDictionary *dict = LinphoneManager.instance.pushDict;
if ([[dict allKeys] indexOfObject:callId] != NSNotFound)
return FALSE;

View file

@ -2161,6 +2161,12 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
}
- (void)startPushLongRunningTask:(NSString *)loc_key callId:(NSString *)callId {
if (!callId)
return;
if ([callId isEqualToString:@""])
return;
if ([loc_key isEqualToString:@"IM_MSG"]) {
[[UIApplication sharedApplication] endBackgroundTask:pushBgTaskMsg];
pushBgTaskMsg = 0;