diff --git a/DuckDuckGo/AppDelegate.swift b/DuckDuckGo/AppDelegate.swift index 7caf675ebd..91ebd47063 100644 --- a/DuckDuckGo/AppDelegate.swift +++ b/DuckDuckGo/AppDelegate.swift @@ -191,12 +191,18 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // MARK: Sync initialisation +#if DEBUG + let defaultEnvironment = ServerEnvironment.development +#else + let defaultEnvironment = ServerEnvironment.production +#endif + let environment = ServerEnvironment( UserDefaultsWrapper( key: .syncEnvironment, - defaultValue: ServerEnvironment.production.description + defaultValue: defaultEnvironment.description ).wrappedValue - ) ?? .production + ) ?? defaultEnvironment syncDataProviders = SyncDataProviders(bookmarksDatabase: bookmarksDatabase, secureVaultErrorReporter: SecureVaultErrorReporter.shared) let syncService = DDGSync(dataProvidersSource: syncDataProviders, errorEvents: SyncErrorHandler(), log: .syncLog, environment: environment)