DEEPLINKX / app

2GIS

2GIS actions, setup, native platforms, and fallback options.

DeeplinkX 1.5.8 · Source

Platforms and setup

Native platforms: ios, android.

Public actions

TwoGis.open

factory TwoGis.open({final bool fallbackToStore = false})

Launch with DeeplinkX.launchApp. Native platforms: ios, android. Action web fallback: available. Store-fallback flag: supported; opt in explicitly.

ParameterTypeRequiredDefault
fallbackToStoreboolNofalse

Exact source

TwoGis.view

static TwoGisViewAction view({ required final Coordinate coordinate, final bool fallbackToStore = false, })

Launch with DeeplinkX.launchAction. Native platforms: ios, android. Action web fallback: available. Store-fallback flag: supported; opt in explicitly.

ParameterTypeRequiredDefault
coordinateCoordinateYes—
fallbackToStoreboolNofalse

Exact source

TwoGis.directionsWithCoords

static TwoGisDirectionsWithCoordsAction directionsWithCoords({ required final Coordinate destination, final Coordinate? origin, final TwoGisTravelMode mode = TwoGisTravelMode.driving, final bool fallbackToStore = false, })

Launch with DeeplinkX.launchAction. Native platforms: ios, android. Action web fallback: available. Store-fallback flag: supported; opt in explicitly.

ParameterTypeRequiredDefault
destinationCoordinateYes—
originCoordinate?No—
modeTwoGisTravelModeNoTwoGisTravelMode.driving
fallbackToStoreboolNofalse

Exact source

Provider setup and examples

DeeplinkX supports the 2GIS custom URI scheme on iOS and Android for opening the app, showing a coordinate, and building coordinate routes.

References

Available Actions

Launch 2GIS

final deeplinkX = DeeplinkX();
await deeplinkX.launchApp(TwoGis.open());

View Map

Android 2GIS does not expose a marker-by-coordinate URI, so the Android intent opens the supported route flow to the coordinate.

await deeplinkX.launchAction(
  TwoGis.view(
    coordinate: const Coordinate(latitude: 55.76009, longitude: 37.648801),
  ),
);

Directions With Coordinates

await deeplinkX.launchAction(
  TwoGis.directionsWithCoords(
    origin: const Coordinate(latitude: 55.751244, longitude: 37.618423),
    destination: const Coordinate(latitude: 55.76009, longitude: 37.648801),
    mode: TwoGisTravelMode.transit,
  ),
);

2GIS route URLs are coordinate based, so DeeplinkX does not expose a text-only directions action for this app.

Platform Configuration

iOS

Add the 2GIS scheme to the LSApplicationQueriesSchemes array in ios/Runner/Info.plist:

<string>dgis</string>

Android

Allow querying the package in android/app/src/main/AndroidManifest.xml:

<queries>
  <package android:name="ru.dublgis.dgismobile" />
</queries>

URI Formats

  • iOS view map: dgis://2gis.ru/geo/{longitude},{latitude}
  • Android view map intent data: dgis://2gis.ru/routeSearch/rsType/car/to/{longitude},{latitude}
  • Directions with coordinates: dgis://2gis.ru/routeSearch/rsType/{car|ctx|pedestrian}/from/{originLongitude},{originLatitude}/to/{destinationLongitude},{destinationLatitude}
  • Destination-only directions: dgis://2gis.ru/routeSearch/rsType/{car|ctx|pedestrian}/to/{destinationLongitude},{destinationLatitude}

TwoGisTravelMode.auto remains as a deprecated source-compatible alias but emits the supported car value. Transit custom links and web fallbacks emit the provider-documented ctx. The package-targeted Android intent uses bus, which is the value accepted by the current Android app for selecting public transport. Longitude-latitude ordering and Android's marker-to-route behavior remain compatible with existing integrations.

Fallback Behavior

  1. DeeplinkX opens the native app when installed.
  2. If the app is missing and fallbackToStore is true, we redirect to the appropriate store listing.
  3. Otherwise the action falls back to https://2gis.ru with the same path.
  4. Set disableFallback: true when calling launchAction to skip both store and web fallbacks.

Fallback Support Matrix

ActionStore FallbackWeb Fallback
Open appYesYes (website)
View mapYesYes
Directions with coordinatesYesYes