mapzone_speed_alert 2.0.0
mapzone_speed_alert: ^2.0.0 copied to clipboard
MapZone Speed Alert SDK for Flutter: real-time speed-limit, camera, toll and road-restriction alerts with voice, for Android and iOS.
2.0.0 #
Native SDK 3.0.1: signed-in sessions. See the README section Migrating from 1.0.x to 2.0.0.
Breaking
AlertConfig.vehicleId→identity(who is signed in on this device).initializesigns it in; call it on every sign-in and every app launch.AlertConfig.weight(int, kg) →weightTons(double, tonnes);configureVehicle(weight:)→configureVehicle(weightTons:).VehicleTypevalues are now the server's codes:car1,taxi2,bus3,coach4,truck5,motorcycle7.bicycle,pedestrianandemergencyare removed.VehicleType.fromValuereturnsnullfor an unknown code instead ofcar.initialize/configureVehiclethrowPlatformException(INVALID_CONFIGURATION)with the SDK's reason when an input is rejected; nothing is applied and the previous configuration stays in effect, and the loaded zone and signs are left as they were.configureVehiclebeforeinitialize, or afterlogout, throwsNOT_INITIALIZED.- Removed
AlertResult.codeExpiredApiKey,isExpiredApiKey,codeInvalidParameterandisNetworkError: their codes changed meaning in the native SDK. UseMapZoneErrorCode.
Added
logout()→Future<AlertResult>: signs the identity out; zone fetches stop at once.AlertConfig.metadata(Map<String, Object?>?), stored with the session.onSnappedLocationstream +SnappedLocation: each matched fix on the road, with the road bearing. Computed natively only while listened to.MapZoneErrorCode: every code of the native 3.0.1 table, including the session codes2006,2007,2008,2010,3011,3012,4001,-6,-8.
Changed
- Android native GPS capture (
start()): Fused Location when Play Services is usable, otherwise the OSgps+networkproviders (network only while GPS is silent), instead of thegpsprovider alone — fixes now arrive indoors. Without a heading, or below 1 m/s, the last heading is kept instead of0. Adds a dependency onplay-services-location21.3.0. iOS unchanged.start()now fails withNO_LOCATION_SERVICEwhen no source can start (wasLOCATION_ERROR); a source lost after a successful start is reported ononResultasMapZoneErrorCode.locationUnavailable. Coordinates are logged only in debuggable builds. - Native GPS capture errors are reported on
onResultwith plugin codes-100(locationUnavailable, both platforms) and-101(locationPermissionDenied, iOS only) instead of-1, which is the native SDK's "response could not be verified". iOS no longer reports "Always authorization required for background location" while capture runs with when-in-use permission. - Example app: identity field and sign-out in the settings dialog, a
"signed in elsewhere" dialog on
2006, weight in tonnes, the six vehicle types.
1.0.0 #
Native SDK upgrade and package rename. See the README section Migrating from mapzone_flutter_alert_plugin 0.0.x.
Breaking
- Package renamed
mapzone_flutter_alert_plugin→mapzone_speed_alert(importpackage:mapzone_speed_alert/mapzone_speed_alert.dart; iOS podmapzone_speed_alert; Android packagecom.mapzone.mapzone_speed_alert; channelmapzone_speed_alert). VietmapAlertController→MapZoneSpeedAlert,VietmapAlertPlatform→MapZoneSpeedAlertPlatform,MethodChannelVietmapAlert→MethodChannelMapZoneSpeedAlert.- Voice: the SDK now plays alerts through its built-in player. Listening to
onVoicesilences it and forwards every clip to Dart, as before; cancelling every subscription hands playback back to the SDK. getLinkCoordsis deprecated and always returnsnull(removed from the native SDK).
Added
onRestrictionstream +RestrictionEvent: no stopping / parking, closed road, vehicle ban and built-up-area signs with distances (inBuawhile inside). A new listener receives the current state immediately.VoiceAlertType.noStopping(19),roadClosed(20),vehicleRestricted(21).setVoiceProfile(VoiceProfile.full | dingOnly)andsetVoiceSpeed(double).processExternalLocation(fixTimeMillis: …)— the fix's own timestamp, used by the engine for voice throttling and stop detection (defaults to the time of the call).
Changed
- Native SDK: Android
mapzone_speed_alert_android2.0.6(JitPack), iOSMapZoneSpeedAlertSDK2.0.5(CocoaPods). initialize/configureVehiclereset and re-configure the native engine (no new Android manager; iOS rebuilds its thin manager so restriction signs are re-announced). Mute, voice profile and voice speed surviveconfigureVehicle. Native callbacks are installed only by the Flutter engine that configures, so background engines no longer interfere.- A non-https
baseUrlcompletesinitialize/configureVehiclewithPlatformException(CONFIGURE_FAILED)on both platforms. - Example app: restriction-sign row under the speed chip; the three new categories in the voice-mute sheet.
0.0.2 #
- Docs / metadata only — no API or behaviour change.
- Rebranded the package description, README and CHANGELOG to MapZone Speed
Alert SDK; replaced the
vietmappub.dev topic withmapzone.
0.0.1 #
- Initial release of
mapzone_flutter_alert_plugin. - Wraps the MapZone Speed Alert SDK, resolved from the published native
packages: Android
com.github.mapzone-global:mapzone_speed_alert_android:2.0.1(JitPack) and iOSMapZoneSpeedAlertSDK2.0.1(CocoaPods). - Two GPS modes: standalone (the plugin captures native GPS and drives the
engine) and injected (feed snapped GPS via
processExternalLocation()for navigation integration). - Event streams:
onAlert(speed-limit / next-sign / camera / toll signs + distances + speed status),onVoice(WAV bytes + trigger + priority),onReady,onResult(errors),onLocation. - Sign images are delivered as PNG bytes with native change-detection caching.
- Per-category voice muting:
setMutedAlertTypes(List<VoiceAlertType>)+ theVoiceAlertTypeenum, on both Android and iOS. Muting a camera / toll category also hides its on-screen sign; speed-limit and speeding cues can never be muted. - Utilities:
updateZoneLocation(lat, lng)(zone warm-up) andgetLinkCoords(linkId)(Android-only matched-link polyline). AlertConfigreads the app's own bundle id / package name natively — nobundleIdfield to pass.- Example app: a single map screen with destination search (autocomplete / place v4), simulated navigation, a speed-limit / camera / toll sign HUD, a speed chip, per-category voice muting, and a vehicle-profile / simulation settings dialog.