try to ensure registered for notification

This commit is contained in:
Danmei Chen 2020-03-31 13:59:09 +02:00
parent 79ed950062
commit 10432eb1ca
2 changed files with 2 additions and 2 deletions

View file

@ -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) {

View file

@ -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;