fix devices < ios13 can not display incoming call

This commit is contained in:
Danmei Chen 2020-04-14 20:47:47 +02:00
parent a9952c479d
commit dca88588d4

View file

@ -363,20 +363,22 @@ static RootViewManager *rootViewManagerInstance = nil;
case LinphoneCallIncomingReceived: case LinphoneCallIncomingReceived:
if (!CallManager.callKitEnabled) { if (!CallManager.callKitEnabled) {
[self displayIncomingCall:call]; [self displayIncomingCall:call];
} else if ([LinphoneManager.instance lpConfigIntForKey:@"unexpected_pushkit" withDefault:0] > 3) { } else if(@available(iOS 13.0, *)) {
dispatch_async(dispatch_get_main_queue(), ^{ if ([LinphoneManager.instance lpConfigIntForKey:@"unexpected_pushkit" withDefault:0] > 3) {
linphone_call_decline(call, LinphoneReasonUnknown); dispatch_async(dispatch_get_main_queue(), ^{
UIAlertController *errView = linphone_call_decline(call, LinphoneReasonUnknown);
[UIAlertController alertControllerWithTitle:NSLocalizedString(@"Push token for calls is not valid anymore", nil) UIAlertController *errView =
[UIAlertController alertControllerWithTitle:NSLocalizedString(@"Push token for calls is not valid anymore", nil)
message:NSLocalizedString(@"Please delete all of your accounts from the server.", nil) message:NSLocalizedString(@"Please delete all of your accounts from the server.", nil)
preferredStyle:UIAlertControllerStyleAlert]; preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:@"OK" UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:@"OK"
style:UIAlertActionStyleDefault style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {}]; handler:^(UIAlertAction *action) {}];
[errView addAction:defaultAction]; [errView addAction:defaultAction];
[self presentViewController:errView animated:YES completion:nil];}); [self presentViewController:errView animated:YES completion:nil];});
}
} }
break; break;
case LinphoneCallIncomingEarlyMedia: { case LinphoneCallIncomingEarlyMedia: {