mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 19:18:06 +00:00
Stop call notification repetition when app in foreground
This commit is contained in:
parent
01cb68e80e
commit
b310e0976d
1 changed files with 13 additions and 11 deletions
|
|
@ -616,17 +616,19 @@ static void linphone_iphone_display_status(struct _LinphoneCore *lc, const char
|
|||
|
||||
- (void)userNotifContinue:(NSTimer *)timer {
|
||||
UNNotificationContent *content = [timer userInfo];
|
||||
if (content) {
|
||||
LOGI(@"cancelling/presenting user notif");
|
||||
UNNotificationRequest *req = [UNNotificationRequest requestWithIdentifier:@"call_request" content:content trigger:NULL];
|
||||
[[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:req withCompletionHandler:^(NSError * _Nullable error) {
|
||||
// Enable or disable features based on authorization.
|
||||
if (error) {
|
||||
LOGD(@"Error while adding notification request :");
|
||||
LOGD(error.description);
|
||||
}
|
||||
}];
|
||||
}
|
||||
if (content && [UIApplication sharedApplication].applicationState == UIApplicationStateBackground) {
|
||||
LOGI(@"cancelling/presenting user notif");
|
||||
UNNotificationRequest *req =
|
||||
[UNNotificationRequest requestWithIdentifier:@"call_request" content:content trigger:NULL];
|
||||
[[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:req
|
||||
withCompletionHandler:^(NSError *_Nullable error) {
|
||||
// Enable or disable features based on authorization.
|
||||
if (error) {
|
||||
LOGD(@"Error while adding notification request :");
|
||||
LOGD(error.description);
|
||||
}
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue