@octane-xplat/geolocation
v0.14.0
Published
Device geolocation for Octane xplat — matching web + NativeScript implementations
Maintainers
Readme
@octane-xplat/geolocation
pnpm add @octane-xplat/geolocationDevice geolocation behind one capability object. iOS and Android run
@nativescript/geolocation; web uses navigator.geolocation; the macOS
AppKit dev host reports supported: false (no CoreLocation bridge).
import { geolocation } from '@octane-xplat/geolocation'
if ((await geolocation.ensure()) === 'granted') {
const pos = await geolocation.impl!.getCurrentPosition()
// { latitude, longitude, accuracy, altitude, heading, speed, timestamp }
}The shared capability contract: supported reports whether an
implementation exists on this target, ensure() resolves
'granted' | 'denied' | 'unsupported' (it prompts where the platform
defers the prompt), and impl is the service once usable. Nullable
altitude/heading/speed mean the platform did not report them.
Guide: Using device features;
per-target availability: platform notes.
Exercised by the harness Services screen
(packages/app/src/Services.tsrx).
