From 2a1bd88741fed04ee9a9cc2b78c44b921684346a Mon Sep 17 00:00:00 2001 From: QuentinArguillere Date: Sun, 10 Dec 2023 11:08:21 +0100 Subject: [PATCH] Allow push notifications in the app, and update account and core settings to allow VOIP push parameters generation for register --- Linphone/Core/CoreContext.swift | 2 ++ Linphone/Info.plist | 5 +++++ Linphone/Linphone.entitlements | 4 ++++ Linphone/UI/Assistant/Viewmodel/AccountLoginViewModel.swift | 3 +++ 4 files changed, 14 insertions(+) diff --git a/Linphone/Core/CoreContext.swift b/Linphone/Core/CoreContext.swift index 7d9bb5e6e..ce607a4da 100644 --- a/Linphone/Core/CoreContext.swift +++ b/Linphone/Core/CoreContext.swift @@ -86,6 +86,8 @@ final class CoreContext: ObservableObject { self.mCore.autoIterateEnabled = false self.mCore.friendsDatabasePath = "\(configDir)/friends.db" + self.mCore.callkitEnabled = true + self.mCore.pushNotificationEnabled = true self.mCore.friendListSubscriptionEnabled = true diff --git a/Linphone/Info.plist b/Linphone/Info.plist index c3b52b04f..5aaaf7fac 100644 --- a/Linphone/Info.plist +++ b/Linphone/Info.plist @@ -11,6 +11,11 @@ NotoSans-Bold.ttf NotoSans-ExtraBold.ttf + UIBackgroundModes + + remote-notification + voip + UILaunchScreen UIImageName diff --git a/Linphone/Linphone.entitlements b/Linphone/Linphone.entitlements index 5e9048f46..f88b0a974 100644 --- a/Linphone/Linphone.entitlements +++ b/Linphone/Linphone.entitlements @@ -2,6 +2,10 @@ + aps-environment + development + com.apple.developer.aps-environment + development com.apple.security.app-sandbox com.apple.security.application-groups diff --git a/Linphone/UI/Assistant/Viewmodel/AccountLoginViewModel.swift b/Linphone/UI/Assistant/Viewmodel/AccountLoginViewModel.swift index e9150c82c..dd9149693 100644 --- a/Linphone/UI/Assistant/Viewmodel/AccountLoginViewModel.swift +++ b/Linphone/UI/Assistant/Viewmodel/AccountLoginViewModel.swift @@ -89,6 +89,9 @@ class AccountLoginViewModel: ObservableObject { try accountParams.setServeraddress(newValue: address) // And we ensure the account will start the registration process accountParams.registerEnabled = true + accountParams.pushNotificationAllowed = true + accountParams.remotePushNotificationAllowed = false + accountParams.pushNotificationConfig?.provider = "apns.dev" // Now that our AccountParams is configured, we can create the Account object let account = try core.createAccount(params: accountParams)