Disable push notifications when pushNotificationAllowed is false

This commit is contained in:
Benoit Martins 2025-09-19 11:15:18 +02:00
parent 0dfdb5551c
commit 147682a0e5
2 changed files with 7 additions and 3 deletions

View file

@ -146,7 +146,8 @@ class CoreContext: ObservableObject {
self.mCore = try? Factory.Instance.createSharedCoreWithConfig(config: Config.get(), systemContext: Unmanaged.passUnretained(coreQueue).toOpaque(), appGroupId: Config.appGroupName, mainCore: true)
self.mCore.callkitEnabled = true
self.mCore.pushNotificationEnabled = true
self.mCore.pushNotificationEnabled = self.mCore.defaultAccount?.params?.pushNotificationAllowed ?? false
let appName = Bundle.main.infoDictionary?["CFBundleName"] as? String
let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String

View file

@ -107,8 +107,11 @@ 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 = true
if accountParams.pushNotificationAllowed {
accountParams.pushNotificationAllowed = true
accountParams.remotePushNotificationAllowed = true
}
#if DEBUG
let pushEnvironment = ".dev"
#else