diff --git a/Classes/CallManager.swift b/Classes/CallManager.swift index db42576f1..318dbb4ed 100644 --- a/Classes/CallManager.swift +++ b/Classes/CallManager.swift @@ -394,7 +394,7 @@ class CoreManagerDelegate: CoreDelegate { // The call is already answered. CallManager.instance().acceptCall(call: call, hasVideo: video) } - } else if (!CallManager.instance().alreadyRegisteredForNotification) { + } else if (!(CallManager.instance().alreadyRegisteredForNotification && UIApplication.shared.isRegisteredForRemoteNotifications)) { CallManager.instance().displayIncomingCall(call: call, handle: address, hasVideo: video, callId: callId!) } } else if (UIApplication.shared.applicationState != .active) { diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 87020f4d6..c6de201be 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -152,7 +152,7 @@ #pragma deploymate push "ignored-api-availability" - (void)registerForNotifications { - if (CallManager.instance.alreadyRegisteredForNotification) + if (CallManager.instance.alreadyRegisteredForNotification && [[UIApplication sharedApplication] isRegisteredForRemoteNotifications]) return; CallManager.instance.alreadyRegisteredForNotification = true;