Platforms and setup
Native platforms: ios, macos.
Public actions
AppleMaps.open
factory AppleMaps.open({final bool fallbackToStore = false})
Launch with DeeplinkX.launchApp. Native platforms: ios, macos. Action web fallback: available. Store-fallback flag: supported; opt in explicitly.
| Parameter | Type | Required | Default |
|---|---|---|---|
fallbackToStore | bool | No | false |
AppleMaps.view
static AppleMapsViewAction view({ required final Coordinate coordinate, final double? zoom, final bool fallbackToStore = false, })
Launch with DeeplinkX.launchAction. Native platforms: ios, macos. Action web fallback: available. Store-fallback flag: supported; opt in explicitly.
| Parameter | Type | Required | Default |
|---|---|---|---|
coordinate | Coordinate | Yes | — |
zoom | double? | No | — |
fallbackToStore | bool | No | false |
AppleMaps.search
static AppleMapsSearchAction search({ required final String query, final bool fallbackToStore = false, })
Launch with DeeplinkX.launchAction. Native platforms: ios, macos. Action web fallback: available. Store-fallback flag: supported; opt in explicitly.
| Parameter | Type | Required | Default |
|---|---|---|---|
query | String | Yes | — |
fallbackToStore | bool | No | false |
AppleMaps.directions
static AppleMapsDirectionsAction directions({ required final String destination, final String? origin, final AppleMapsTransportType? mode, final bool fallbackToStore = false, })
Launch with DeeplinkX.launchAction. Native platforms: ios, macos. Action web fallback: available. Store-fallback flag: supported; opt in explicitly.
| Parameter | Type | Required | Default |
|---|---|---|---|
destination | String | Yes | — |
origin | String? | No | — |
mode | AppleMapsTransportType? | No | — |
fallbackToStore | bool | No | false |
AppleMaps.directionsWithCoords
static AppleMapsDirectionsWithCoordsAction directionsWithCoords({ required final Coordinate destination, final Coordinate? origin, final AppleMapsTransportType? mode, final bool fallbackToStore = false, })
Launch with DeeplinkX.launchAction. Native platforms: ios, macos. Action web fallback: available. Store-fallback flag: supported; opt in explicitly.
| Parameter | Type | Required | Default |
|---|---|---|---|
destination | Coordinate | Yes | — |
origin | Coordinate? | No | — |
mode | AppleMapsTransportType? | No | — |
fallbackToStore | bool | No | false |
Provider setup and examples
DeeplinkX provides support for Apple Maps deep linking actions on iOS and macOS devices.
References
Available Actions
Launch Apple Maps App
final deeplinkX = DeeplinkX();
await deeplinkX.launchApp(AppleMaps.open());
View Map Action
await deeplinkX.launchAction(
AppleMaps.view(
coordinate: const Coordinate(latitude: 40.7812, longitude: -73.9665),
zoom: 12.5,
),
);
Search Location Action
await deeplinkX.launchAction(
AppleMaps.search(query: 'Central Park, New York'),
);
Directions Action
await deeplinkX.launchAction(
AppleMaps.directions(
origin: 'Central Park, New York',
destination: 'Statue of Liberty',
mode: AppleMapsTransportType.transit,
),
);
Directions with Coordinates Action
await deeplinkX.launchAction(
AppleMaps.directionsWithCoords(
origin: const Coordinate(latitude: 40.7812, longitude: -73.9665),
destination: const Coordinate(latitude: 40.6892, longitude: -74.0445),
mode: AppleMapsTransportType.walking,
),
);
Platform Configuration
iOS
Add the following to your ios/Runner/Info.plist inside the LSApplicationQueriesSchemes array:
<string>maps</string>
macOS
Add the same scheme entry to your macos/Runner/Info.plist inside the LSApplicationQueriesSchemes array:
<string>maps</string>
Apple Maps deeplinks are available on iOS and macOS. Android is not supported.
URL Schemes
Native App Deep Links
- View map:
maps://?ll={lat},{lng}&z={zoom} - Search:
maps://?q={query} - Directions:
maps://?saddr={origin}&daddr={destination}&dirflg={mode} - Directions with coordinates:
maps://?saddr={origin_lat},{origin_lng}&daddr={dest_lat},{dest_lng}&dirflg={mode}
Web Fallback URLs
- View map:
https://maps.apple.com/?ll={lat},{lng}&z={zoom} - Search:
https://maps.apple.com/?q={query} - Directions:
https://maps.apple.com/?saddr={origin}&daddr={destination}&dirflg={mode} - Directions with coordinates:
https://maps.apple.com/?saddr={origin_lat},{origin_lng}&daddr={dest_lat},{dest_lng}&dirflg={mode}
dirflg accepts:
d– Drivingw– Walkingr– Transit
Supported Fallback Stores
When the Apple Maps app is not installed (removed from the device), DeeplinkX can redirect users to download it from:
- iOS App Store
Enable fallback with the fallbackToStore parameter when launching actions or apps.
Fallback Behavior
- Attempt to launch the Apple Maps app if installed.
- If not installed and
fallbackToStoreistrue, redirect to the iOS App Store listing. - If the store cannot be opened, fall back to opening the Apple Maps website.
- Disable all fallbacks by setting
disableFallback: true.
Fallback Support for Actions
| Action | Store Fallback | Web Fallback |
|---|---|---|
| Open app | ✔️ | ✔️ |
| View map | ✔️ | ✔️ |
| Search | ✔️ | ✔️ |
| Directions | ✔️ | ✔️ |
| Directions with coordinates | ✔️ | ✔️ |