From 41cfad6ad8bcfb304c7e2da7a1dee77a9a39dd73 Mon Sep 17 00:00:00 2001 From: QuentinArguillere Date: Thu, 16 Sep 2021 16:54:11 +0200 Subject: [PATCH] After configuring, set the new account(s) pn provider back to 'apns.dev' or 'apns' depending on the buildwq --- Classes/AssistantView.m | 1 + Classes/LinphoneManager.h | 1 + Classes/LinphoneManager.m | 14 +++++++++----- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Classes/AssistantView.m b/Classes/AssistantView.m index 4b5c58930..04afeb889 100644 --- a/Classes/AssistantView.m +++ b/Classes/AssistantView.m @@ -991,6 +991,7 @@ static UICompositeViewDescription *compositeDescription = nil; // we successfully loaded a remote provisioned config, go to dialer [LinphoneManager.instance lpConfigSetInt:[NSDate new].timeIntervalSince1970 forKey:@"must_link_account_time"]; + [LinphoneManager.instance configurePushProviderForAccounts]; if (number_of_accounts_before < bctbx_list_size(linphone_core_get_account_list(LC))) { LOGI(@"A proxy config was set up with the remote provisioning, skip assistant"); [self onDialerClick:nil]; diff --git a/Classes/LinphoneManager.h b/Classes/LinphoneManager.h index 235caee7c..53be84967 100644 --- a/Classes/LinphoneManager.h +++ b/Classes/LinphoneManager.h @@ -113,6 +113,7 @@ typedef struct _LinphoneManagerSounds { + (NSString *)getUserAgent; + (int)unreadMessageCount; +- (void)configurePushProviderForAccounts; - (void)playMessageSound; - (void)resetLinphoneCore; - (void)launchLinphoneCore; diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 3de5afe82..fc2a91d95 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -1305,11 +1305,7 @@ void popup_link_account_cb(LinphoneAccountCreator *creator, LinphoneAccountCreat } } -- (void)startLinphoneCore { - bool corePushEnabled = [self lpConfigIntForKey:@"net" inSection:@"push_notification"]; - linphone_core_set_push_notification_enabled([LinphoneManager getLc], corePushEnabled); - linphone_core_start([LinphoneManager getLc]); - +- (void)configurePushProviderForAccounts { const MSList *accountsList = linphone_core_get_account_list(theLinphoneCore); while (accountsList) { LinphoneAccount * account = accountsList->data; @@ -1332,6 +1328,14 @@ void popup_link_account_cb(LinphoneAccountCreator *creator, LinphoneAccountCreat } } +- (void)startLinphoneCore { + bool corePushEnabled = [self lpConfigIntForKey:@"net" inSection:@"push_notification"]; + linphone_core_set_push_notification_enabled([LinphoneManager getLc], corePushEnabled); + linphone_core_start([LinphoneManager getLc]); + + [self configurePushProviderForAccounts]; +} + - (void)createLinphoneCore { [self migrationAllPre]; if (theLinphoneCore != nil) {