From 1ceec3d44ec62e0623ecb7a57735dd25cf85c3d9 Mon Sep 17 00:00:00 2001 From: Danmei Chen Date: Tue, 3 Dec 2019 11:29:58 +0100 Subject: [PATCH] fix download remote provisioning after another account logined --- Classes/AssistantView.m | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Classes/AssistantView.m b/Classes/AssistantView.m index 61c5409fd..d288dc31a 100644 --- a/Classes/AssistantView.m +++ b/Classes/AssistantView.m @@ -1441,7 +1441,22 @@ void assistant_is_account_linked(LinphoneAccountCreator *creator, LinphoneAccoun - (IBAction)onRemoteProvisioningDownloadClick:(id)sender { ONCLICKBUTTON(sender, 100, { [_waitView setHidden:false]; - [self resetLiblinphone:TRUE]; + if (number_of_configs_before > 0) { + // TODO remove ME when it is fixed in SDK. + linphone_core_set_provisioning_uri(LC, NULL); + UIAlertController *errView = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Provisioning Load error", nil) + message:NSLocalizedString(@"Please remove other accounts before remote provisioning.", nil) + preferredStyle:UIAlertControllerStyleAlert]; + + UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK" + style:UIAlertActionStyleDefault + handler:^(UIAlertAction * action) {}]; + + [errView addAction:defaultAction]; + [self presentViewController:errView animated:YES completion:nil]; + } else { + [self resetLiblinphone:TRUE]; + } }); }