# Neshan

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

DeeplinkX 1.5.8.

## Platforms and setup

Native platforms: **ios, android**.



## Public actions

### Neshan.open


```dart
factory Neshan.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/neshan.dart#L9)

### Neshan.view


```dart
static NeshanViewAction 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**.

| Parameter | Type | Required | Default |
| --- | --- | --- | --- |
| `coordinate` | `Coordinate` | Yes | — |
| `fallbackToStore` | `bool` | No | `false` |

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

### Neshan.directionsWithCoords


```dart
static NeshanDirectionsWithCoordsAction directionsWithCoords({ required final Coordinate destination, final Coordinate? origin, 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 | — |
| `fallbackToStore` | `bool` | No | `false` |

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


## Provider setup and examples
DeeplinkX supports Neshan's native iOS `neshan` URI scheme and Android package-targeted `https://nshn.ir` map links so Flutter apps can open map coordinates or launch coordinate-based directions in Neshan on iOS and Android.

## References

- Neshan App Store listing: <https://apps.apple.com/us/app/neshan-map/id1548188093>
- Neshan web map fallback: <https://neshan.org/maps>

## Available Actions

### Launch Neshan

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

### View Map

```dart
await deeplinkX.launchAction(
  Neshan.view(
    coordinate: const Coordinate(latitude: 35.6892, longitude: 51.3890),
  ),
);
```

### Directions With Coordinates

```dart
await deeplinkX.launchAction(
  Neshan.directionsWithCoords(
    origin: const Coordinate(latitude: 35.6892, longitude: 51.3890),
    destination: const Coordinate(latitude: 35.7000, longitude: 51.4000),
  ),
);
```

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

## Platform Configuration

### iOS

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

```xml
<string>neshan</string>
```

### Android

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

```xml
<queries>
  <package android:name="org.rajman.neshan.traffic.tehran.navigator" />
</queries>
```

## URI Formats

- iOS view map: `neshan://?destination={latitude},{longitude}`
- Android package-targeted view map: `https://nshn.ir?lat={latitude}&lng={longitude}`
- Web view fallback: `https://neshan.org/maps/share/{latitude},{longitude}`
- iOS directions: `neshan://?origin={originLatitude},{originLongitude}&destination={destinationLatitude},{destinationLongitude}`
- Android package-targeted directions: `https://nshn.ir/?origin={originLatitude},{originLongitude}&destination={destinationLatitude},{destinationLongitude}`
- Web directions fallback: `https://neshan.org/maps`

## 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 view actions use Neshan's canonical share URL and directions open
   the canonical web map.
4. Set `disableFallback: true` when calling `launchAction` to skip both store and web fallbacks.

The Android `nshn.ir` URI remains useful when package-targeted to the installed
app, but the live web redirect discards route query parameters. DeeplinkX
therefore does not reuse that short URL as a browser fallback.

### Fallback Support Matrix

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

