Platforms and setup
Native platforms: ios, android.
Public actions
Neshan.open
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 |
Neshan.view
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 |
Neshan.directionsWithCoords
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 |
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
final deeplinkX = DeeplinkX();
await deeplinkX.launchApp(Neshan.open());
View Map
await deeplinkX.launchAction(
Neshan.view(
coordinate: const Coordinate(latitude: 35.6892, longitude: 51.3890),
),
);
Directions With Coordinates
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:
<string>neshan</string>
Android
Allow querying the package in android/app/src/main/AndroidManifest.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
- DeeplinkX opens the native app when installed.
- If the app is missing and
fallbackToStoreistrue, we redirect to the appropriate store listing. - Otherwise view actions use Neshan's canonical share URL and directions open the canonical web map.
- Set
disableFallback: truewhen callinglaunchActionto 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 |