From e58437ecb2253652413783bcb6759c57e5c4a6a8 Mon Sep 17 00:00:00 2001 From: Danmei Chen Date: Tue, 31 Mar 2020 21:42:56 +0200 Subject: [PATCH] add alert for forbidden push token --- Classes/PhoneMainView.m | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 88e35d6de..77751a760 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -363,6 +363,20 @@ static RootViewManager *rootViewManagerInstance = nil; case LinphoneCallIncomingReceived: if (!CallManager.callKitEnabled) { [self displayIncomingCall:call]; + } else if ([LinphoneManager.instance lpConfigIntForKey:@"unexpected_pushkit" withDefault:0] > 2) { + dispatch_async(dispatch_get_main_queue(), ^{ + linphone_call_decline(call, LinphoneReasonUnknown); + 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) + preferredStyle:UIAlertControllerStyleAlert]; + + UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:@"OK" + style:UIAlertActionStyleDefault + handler:^(UIAlertAction *action) {}]; + + [errView addAction:defaultAction]; + [self presentViewController:errView animated:YES completion:nil];}); } break; case LinphoneCallIncomingEarlyMedia: {