From c6e2cab237f34390f00d142e8bdde365960dae49 Mon Sep 17 00:00:00 2001 From: Shautvast Date: Tue, 31 Mar 2026 12:29:17 +0200 Subject: [PATCH] Fix: parameter is not a valid OSRM v5 parameter. --- backend/src/routes/routing.rs | 4 -- backend/src/services/osrm.rs | 3 +- mobile/ios/Flutter/AppFrameworkInfo.plist | 2 - mobile/ios/Podfile | 2 +- mobile/ios/Runner.xcodeproj/project.pbxproj | 6 +-- .../xcshareddata/xcschemes/Runner.xcscheme | 2 + mobile/ios/Runner/AppDelegate.swift | 7 +++- mobile/ios/Runner/Info.plist | 38 +++++++++++++++++-- mobile/lib/main.dart | 4 +- 9 files changed, 48 insertions(+), 20 deletions(-) diff --git a/backend/src/routes/routing.rs b/backend/src/routes/routing.rs index c6edbf4..0248e6b 100644 --- a/backend/src/routes/routing.rs +++ b/backend/src/routes/routing.rs @@ -19,7 +19,6 @@ pub struct RouteQuery { steps: Option, geometries: Option, overview: Option, - language: Option, } /// GET /api/route/{profile}/{coordinates} @@ -72,8 +71,6 @@ pub async fn route( ))); } - let language = query.language.as_deref().unwrap_or("en"); - // Check cache let cache_key = CacheService::route_key(&profile, &coordinates, alternatives, steps, geometries, overview); @@ -94,7 +91,6 @@ pub async fn route( steps, geometries, overview, - language, ) .await?; diff --git a/backend/src/services/osrm.rs b/backend/src/services/osrm.rs index 798c684..a10e8cb 100644 --- a/backend/src/services/osrm.rs +++ b/backend/src/services/osrm.rs @@ -41,14 +41,13 @@ impl OsrmService { steps: bool, geometries: &str, overview: &str, - language: &str, ) -> Result { let base = self.base_url_for_profile(profile).ok_or_else(|| { AppError::InvalidParameter(format!("Invalid profile: {profile}")) })?; let url = format!( - "{base}/route/v1/{profile}/{coordinates}?alternatives={alternatives}&steps={steps}&geometries={geometries}&overview={overview}&language={language}" + "{base}/route/v1/{profile}/{coordinates}?alternatives={alternatives}&steps={steps}&geometries={geometries}&overview={overview}" ); let resp = self.client.get(&url).send().await.map_err(|e| { diff --git a/mobile/ios/Flutter/AppFrameworkInfo.plist b/mobile/ios/Flutter/AppFrameworkInfo.plist index 7c56964..391a902 100644 --- a/mobile/ios/Flutter/AppFrameworkInfo.plist +++ b/mobile/ios/Flutter/AppFrameworkInfo.plist @@ -20,7 +20,5 @@ ???? CFBundleVersion 1.0 - MinimumOSVersion - 12.0 diff --git a/mobile/ios/Podfile b/mobile/ios/Podfile index c9339a0..6eafd7e 100644 --- a/mobile/ios/Podfile +++ b/mobile/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '12.0' +# platform :ios, '13.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/mobile/ios/Runner.xcodeproj/project.pbxproj b/mobile/ios/Runner.xcodeproj/project.pbxproj index 1bde15a..3b7d6b4 100644 --- a/mobile/ios/Runner.xcodeproj/project.pbxproj +++ b/mobile/ios/Runner.xcodeproj/project.pbxproj @@ -346,7 +346,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -472,7 +472,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -523,7 +523,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/mobile/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/mobile/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 15cada4..e3773d4 100644 --- a/mobile/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/mobile/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -26,6 +26,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit" shouldUseLaunchSchemeArgsEnv = "YES"> Bool { - GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } + + func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { + GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) + } } diff --git a/mobile/ios/Runner/Info.plist b/mobile/ios/Runner/Info.plist index 9cbc524..a909812 100644 --- a/mobile/ios/Runner/Info.plist +++ b/mobile/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName @@ -24,6 +26,38 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + NSAppTransportSecurity + + NSAllowsLocalNetworking + + + NSLocationAlwaysUsageDescription + Used to show your position on the map. + NSLocationWhenInUseUsageDescription + Used to show your position on the map. + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneClassName + UIWindowScene + UISceneConfigurationName + flutter + UISceneDelegateClassName + FlutterSceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -41,9 +75,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - diff --git a/mobile/lib/main.dart b/mobile/lib/main.dart index 536de63..d2f2e39 100644 --- a/mobile/lib/main.dart +++ b/mobile/lib/main.dart @@ -8,8 +8,7 @@ import 'core/database/app_database.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); - // Load the saved backend URL before building the widget tree so the API - // client is initialized with the correct URL from the first request. + // Create a single database instance shared across the app. final db = AppDatabase(); final savedUrl = await db.getSetting(AppConstants.settingBackendUrl); final backendUrl = savedUrl ?? AppConstants.defaultBackendUrl; @@ -17,6 +16,7 @@ void main() async { runApp( ProviderScope( overrides: [ + appDatabaseProvider.overrideWithValue(db), apiClientProvider.overrideWithValue(ApiClient(baseUrl: backendUrl)), ], child: const PrivacyMapsApp(),