-
Notifications
You must be signed in to change notification settings - Fork 142
showDirections() for Google Maps opens in browser on iOS #218
Copy link
Copy link
Open
Description
I'm experiencing behavior described in #131
A flutter doctor command yields:
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.38.1, on macOS 26.3 25D125 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.3)
[✓] Chrome - develop for the web
[✓] Connected device (4 available)
[✓] Network resources
• No issues found!
I'm using
map_launcher ^4.4.3
and my code reads:
final availableMaps = await _getAvailableMaps();
if (availableMaps.isEmpty) {
log.fine('No maps apps installed, launching Google Maps via web URL');
await _openGoogleMaps(latitude, longitude);
return;
}
final googleMaps = availableMaps
.where((m) => m.mapType == MapType.google)
.firstOrNull;
if (googleMaps != null) {
log.fine('Using Google Maps, because it is installed');
await googleMaps.showDirections(destination: Coords(latitude, longitude));
return;
}
My logs contain:
flutter: FINE | Swellify | (2026-03-07 16:30:02.579572): Using Google Maps, because it is installed
So I'm confirming that the code is "using" Google Maps, however when the code executes, it takes me to Safari first, a Google Maps URL, then there's a modal dialog asking me if I'd like to open up in the Google Maps app. That works, but I would have thought that the phone would go straight to the Google Maps app?
I've got the following in my Info.plist file:
<key>LSApplicationQueriesSchemes</key>
<array>
<string>comgooglemaps</string>
<string>googlemaps</string>
<string>baidumap</string>
<string>iosamap</string>
<string>waze</string>
<string>yandexmaps</string>
<string>yandexnavi</string>
<string>citymapper</string>
<string>mapswithme</string>
<string>osmandmaps</string>
<string>dgis</string>
<string>qqmap</string>
<string>here-location</string>
<string>tomtomgo</string>
<string>copilot</string>
<string>com.sygic.aura</string>
<string>nmap</string>
<string>kakaomap</string>
<string>tmap</string>
<string>szn-mapy</string>
<string>mappls</string>
<string>moovit</string>
<string>neshan</string>
</array>
So, I'm confused! I'm running the test on an iPhone 15, with iOS 26.3 installed.
Let me know if you need anything else. Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels