# Moovit

Canonical HTML: https://p-hatan.com/deeplink-x/apps/moovit/

DeeplinkX 1.5.8.

## Platforms and setup

Native platforms: **ios, android**.



## Public actions

### Moovit.open


```dart
factory Moovit.open({final bool fallbackToStore = false})
```

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

| Parameter | Type | Required | Default |
| --- | --- | --- | --- |
| `fallbackToStore` | `bool` | No | `false` |

[Exact source](https://github.com/DeepLinkX/DeeplinkX/blob/00d9d2c7c1affe4e2ee459a01afeba82a1480eac/lib/src/apps/downloadable_apps/moovit.dart#L9)

### Moovit.view


```dart
static MoovitViewAction view({ required final Coordinate coordinate, final String partnerId = 'deeplink_x', final bool fallbackToStore = false, })
```

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

| Parameter | Type | Required | Default |
| --- | --- | --- | --- |
| `coordinate` | `Coordinate` | Yes | — |
| `partnerId` | `String` | No | `'deeplink_x'` |
| `fallbackToStore` | `bool` | No | `false` |

[Exact source](https://github.com/DeepLinkX/DeeplinkX/blob/00d9d2c7c1affe4e2ee459a01afeba82a1480eac/lib/src/apps/downloadable_apps/moovit.dart#L43)

### Moovit.directionsWithCoords


```dart
static MoovitDirectionsWithCoordsAction directionsWithCoords({ required final Coordinate destination, final Coordinate? origin, final String? destinationTitle, final String? originTitle, final String partnerId = 'deeplink_x', final bool fallbackToStore = false, })
```

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

| Parameter | Type | Required | Default |
| --- | --- | --- | --- |
| `destination` | `Coordinate` | Yes | — |
| `origin` | `Coordinate?` | No | — |
| `destinationTitle` | `String?` | No | — |
| `originTitle` | `String?` | No | — |
| `partnerId` | `String` | No | `'deeplink_x'` |
| `fallbackToStore` | `bool` | No | `false` |

[Exact source](https://github.com/DeepLinkX/DeeplinkX/blob/00d9d2c7c1affe4e2ee459a01afeba82a1480eac/lib/src/apps/downloadable_apps/moovit.dart#L55)


## Provider setup and examples
DeeplinkX supports Moovit's `moovit` URI scheme so Flutter apps can open nearby transit options or launch coordinate-based directions in the native Moovit app on iOS and Android.

## References

- Moovit deeplinking documentation: <https://moovit.com/developers/deeplinking/>
- Moovit App Store listing: <https://apps.apple.com/us/app/moovit-bus-transit-tracker/id498477945>

## Available Actions

### Launch Moovit

```dart
final deeplinkX = DeeplinkX();
await deeplinkX.launchApp(Moovit.open());
```

### View Map

```dart
await deeplinkX.launchAction(
  Moovit.view(
    coordinate: const Coordinate(latitude: 40.7128, longitude: -74.0060),
    partnerId: 'my_flutter_app',
  ),
);
```

### Directions With Coordinates

```dart
await deeplinkX.launchAction(
  Moovit.directionsWithCoords(
    origin: const Coordinate(latitude: 40.7580, longitude: -73.9855),
    originTitle: 'Times Square',
    destination: const Coordinate(latitude: 40.7527, longitude: -73.9772),
    destinationTitle: 'Grand Central',
  ),
);
```

Omit `origin` to let Moovit start from the user's current location.

## Platform Configuration

### iOS

Add the Moovit scheme to the `LSApplicationQueriesSchemes` array in `ios/Runner/Info.plist`:

```xml
<string>moovit</string>
```

### Android

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

```xml
<queries>
  <package android:name="com.tranzmate" />
</queries>
```

## URI Formats

- View map: `moovit://nearby?lat={latitude}&lon={longitude}&partner_id={partnerId}`
- Directions: `moovit://directions?dest_lat={destinationLatitude}&dest_lon={destinationLongitude}&dest_name={destinationTitle}&orig_lat={originLatitude}&orig_lon={originLongitude}&orig_name={originTitle}&partner_id={partnerId}`

`partnerId` is optional and defaults to `deeplink_x`. DeeplinkX emits Moovit's
documented `partner_id` on nearby and directions actions.

## 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://www.moovit.com/`.
4. Set `disableFallback: true` when calling `launchAction` to skip both store and web fallbacks.

### Fallback Support Matrix

| Action                       | Store Fallback | Web Fallback |
| ---------------------------- | -------------- | ------------ |
| Open app                     | Yes            | Yes          |
| View map                     | Yes            | Yes          |
| Directions with coordinates  | Yes            | Yes          |

