From e4ea67b7160273fcde93b51495c1298aca752459 Mon Sep 17 00:00:00 2001 From: QuentinArguillere Date: Wed, 30 Jun 2021 15:16:33 +0200 Subject: [PATCH] Save accept terms state in the config --- Classes/AssistantView.h | 1 - Classes/AssistantView.m | 7 ++++--- Classes/LinphoneAppDelegate.m | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Classes/AssistantView.h b/Classes/AssistantView.h index 7c864eda4..2d0371953 100644 --- a/Classes/AssistantView.h +++ b/Classes/AssistantView.h @@ -33,7 +33,6 @@ size_t number_of_accounts_before; BOOL mustRestoreView; long phone_number_length; - BOOL acceptTerms; } @property(nonatomic) UICompositeViewDescription *outgoingView; diff --git a/Classes/AssistantView.m b/Classes/AssistantView.m index 76f2a742d..4b5c58930 100644 --- a/Classes/AssistantView.m +++ b/Classes/AssistantView.m @@ -62,7 +62,6 @@ typedef enum _ViewElement { historyViews = [[NSMutableArray alloc] init]; currentView = nil; mustRestoreView = NO; - acceptTerms = NO; } return self; } @@ -292,6 +291,7 @@ static UICompositeViewDescription *compositeDescription = nil; } - (void)enableWelcomeViewButtons { + BOOL acceptTerms = [LinphoneManager.instance lpConfigBoolForKey:@"accept_terms" withDefault:FALSE]; UIImage *image = acceptTerms ? [UIImage imageNamed:@"checkbox_checked.png"] : [UIImage imageNamed:@"checkbox_unchecked.png"]; [_acceptButton setImage:image forState:UIControlStateNormal]; _gotoRemoteProvisioningButton.enabled = _gotoLinphoneLoginButton.enabled = _gotoCreateAccountButton.enabled = _gotoLoginButton.enabled = acceptTerms; @@ -1748,7 +1748,8 @@ void assistant_is_account_linked(LinphoneAccountCreator *creator, LinphoneAccoun } - (IBAction)onAcceptTermsClick:(id)sender { - acceptTerms = !acceptTerms; + BOOL acceptTerms = [LinphoneManager.instance lpConfigBoolForKey:@"accept_terms" withDefault:FALSE]; + [LinphoneManager.instance lpConfigSetBool:!acceptTerms forKey:@"accept_terms"]; [self enableWelcomeViewButtons]; } @@ -1759,7 +1760,7 @@ void assistant_is_account_linked(LinphoneAccountCreator *creator, LinphoneAccoun [phoneButton setTitle:[country objectForKey:@"name"] forState:UIControlStateNormal]; UIAssistantTextField* countryCodeField = [self findTextField:ViewElement_PhoneCC]; countryCodeField.text = countryCodeField.lastText = [country objectForKey:@"code"]; - phone_number_length = [[country objectForKey:@"phone_length"] integerValue]; + phone_number_length = [[country objectForKey:@"phone_length "] integerValue]; [self shouldEnableNextButton]; } diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 432f361c1..2fd86fa7a 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -524,7 +524,7 @@ } } - completionHandler(UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionAlert); + completionHandler(UNNotificationPresentationOptionAlert); } - (void)userNotificationCenter:(UNUserNotificationCenter *)center