While building CarPlay/Android Auto guidance on top of onTurnByTurn (SDK 0.16.3), we hit four places where the wire payload differs from the TypeScript declarations. Each cost us a real on-device defect (silently rejected car turn cards), so documenting them with sources:
-
Step distance/time field names don't match. StepInfoSpec (NativeNavModule) declares distanceMeters/durationSeconds, but both native layers emit distanceFromPrevStepMeters/timeFromPrevStepSeconds instead — see ObjectTranslationUtil.getMapFromStepInfo (Android) and NavModule.mm's getDictionaryFromStepInfo (iOS). The spec-named fields are never present at runtime.
-
maneuver is typed string but is a number on the wire. Both platforms putInt/numberWithInteger the platform maneuver constant (which, helpfully, uses identical values 0–65 on both platforms).
-
Fields emitted but untyped: fullRoadName and stepNumber (both platforms), roundaboutTurnNumber/exitNumber (Android) are in the payload but absent from StepInfoSpec.
-
instruction is empty on the final arrival tick (iOS observed; the arrival step arrives with maneuver=DESTINATION and an empty instruction). Worth documenting since instruction reads as always-populated from the types.
Also: TurnByTurnEvent in the public API is an empty interface, so none of the above is even visible to consumers without reading native source. Happy to PR type updates if you'd take them — aligning StepInfoSpec with the actual emitters seems the minimal fix.
While building CarPlay/Android Auto guidance on top of
onTurnByTurn(SDK 0.16.3), we hit four places where the wire payload differs from the TypeScript declarations. Each cost us a real on-device defect (silently rejected car turn cards), so documenting them with sources:Step distance/time field names don't match.
StepInfoSpec(NativeNavModule) declaresdistanceMeters/durationSeconds, but both native layers emitdistanceFromPrevStepMeters/timeFromPrevStepSecondsinstead — seeObjectTranslationUtil.getMapFromStepInfo(Android) andNavModule.mm'sgetDictionaryFromStepInfo(iOS). The spec-named fields are never present at runtime.maneuveris typedstringbut is a number on the wire. Both platformsputInt/numberWithIntegerthe platform maneuver constant (which, helpfully, uses identical values 0–65 on both platforms).Fields emitted but untyped:
fullRoadNameandstepNumber(both platforms),roundaboutTurnNumber/exitNumber(Android) are in the payload but absent fromStepInfoSpec.instructionis empty on the final arrival tick (iOS observed; the arrival step arrives with maneuver=DESTINATION and an empty instruction). Worth documenting sinceinstructionreads as always-populated from the types.Also:
TurnByTurnEventin the public API is an empty interface, so none of the above is even visible to consumers without reading native source. Happy to PR type updates if you'd take them — aligningStepInfoSpecwith the actual emitters seems the minimal fix.