Commit Graph
5 Commits
Author SHA1 Message Date
Diego Romar d47cfdd458 bug: App stuck in NetBird logo on cold start (#50)
* Revert ViewModel creation to synchronous pattern

Since the slow configureManager() call was removed from
NetworkExtensionAdapter.init() and the remaining operations are
lightweight, this asynchronous pattern isn't necessary anymore.

Reason for this commit: app is stuck on netbird logo display on
cold starts. This was corrected but reintroduced when this
ViewModelLoader was introduced.

* Run Firebase after UI is visible

* Bump version to 0.0.16.1

* Add better fit on NetBird logo for loading screen

* Return ViewModelLoader class usage to offload Go runtime initialization

* Return Firebase initializing for iOS using AppDelegate

Issue wasn't related to Firebase

* Return Firebase initialization mechanism for tvOS

* Add loadCurrentConnectionState call on .onAppear

* Bump NetBird and NetBirdNetworkExtension to 0.0.16.3

* Bump tvOS version to v0.0.16.1
2026-01-23 19:51:40 -03:00
Diego Romar 72ab3a55c9 UI reporting wrong connection state when VPN is running (#48)
* Add method to return the current VPN connection state

By checking if there's a VPN Manager instance from preferences
whose name matches the extension's. If so, it sets the extension's
session with its connection, and returns the current VPN status.
Returns false, otherwise.

* Call loadCurrentConnectionState when app becomes active

This will be used to both report the current connection state properly
and configure the ExtensionAdpater's session before polling.

This doesn't start or create a new VPN manager, it only checks for one
that is already running in case the VPN is connected by the time the app
cold starts.

* Guard active state after async operations to prevent background polling

* Bump version to v0.0.16.2
2026-01-23 17:46:34 -03:00
Diego Romar 70ceb88fe3 bug: racing condition when setting isRestartInProgress (#43)
* Add value assingment to isRestarting and isRestartInProgress in the monitor queue's context

* Apply navigation bar modifiers to the ZStack inside the NavigationView

Fixes white bar showing up on versions prior to iOS 16

* Bump version (0.0.14.16)
2025-12-20 12:39:45 +01:00
Diego Romar 675c560a63 Add force relay connection option (#37)
* Add some tests calling sdk method to set environment variable

* Add GlobalConstants and EnvVarPackager

* Add EnvList as parameter to NetBirdSDKClient.run method

* Add option to toggle force relay connection to AdvancedView

MainViewModel code is stil WIP

* Add usage of appGroup when using shared UserDefaults

* Use the defined App Group identifier for userPreferencesSuiteName

* Add ForceRelayAlert to be displayed when user toggles the option in AdvancedView

* Extract code that grays out background when an Alert is displayed in AdvancedView to a common function

* Remove prints

* Replace @StateObject with @EnvironmentObject property wrapper for viewModel in Alerts

Their parent view (AdvancedView) also accesses it via @EnvironmentObject property

* Replace force unwrap with flatMap

* Add default value for keyForceRelayConnection when reading from defaults

If the key isn't set, it will use the value by default

* Update forceRelayConnection property with the provided value when setForcedRelayConnection is called

* Remove redundant parameter for LogLevelAlert

* Add default value usage for keyForceRelayConnection in MainViewModel

* Wrap onConnected()'s self.completionHandler(nil) call with DispatchQueue.main.async

So that the call happens in the main thread to correctly handle UI state update (Connecting... -> Connected)
2025-12-12 14:30:17 -03:00
Diego Romar 87387e9e31 feature: add device registration with setup keys (#35)
* Add NetBird logo to Use NetBird Server button

* Add plus and minus icons

* Add ServerViewModel

* Refactor ServerView to modularize view creation

Still WIP

* Change project file to include new ViewModel

* Add ServerView button actions

* Add Extensions for View and function to hide keyboard

* Add server field error text

* Hide keyboard on button / screen tap

* Make sdk calls non-blocking

* Add URL and setupKey validation on ServerViewModel

* Add enable/disable UI flow

* Use Task.detached on serverView to not lock main thread when calling SDK methods

* Clear SSO not supported message on server textEdit change

* Consolidate error messages and flags

* Change ServerViewErrors to a class/ObservableObject to make SwiftUI detect changes

* Add better exception handling

* Clear setup key field error when toggling Add this device...

* Block Add device toggle when UI is disabled

* Add JustifiedText View implementation to justify text

* Set height on JustifiedText as optional

Add early return if view width calculation isn't ready

* Remove redundant guard

* Rename closure parameter

Also add ViewModel environment object to #Preview

* Replace usage of Color(red: 0, green: 0, blue: 0, opacity: 0) with Color.clear

* Add user input sanitization

* Add tap gesture to dismiss keyboard when tapping outside of an input field

* Bump version to 0.0.13.4

* Add ellipsis animation to Validating text when UI is blocked

* Bump version to 0.0.13.5
2025-12-03 15:53:48 -03:00