location.LocationTaskRun
What a location task receives: the fixes since its last run, oldest first.
Verwendung
Persist each batch of positions delivered to a background location task.
// Persist each batch of positions delivered to a background location task.
import { location, storage } from 'kuito';
location.defineUpdates('trip', async (run: location.LocationTaskRun) => {
await storage.set('latest-trip-batch', JSON.stringify(run.locations));
});
// Register at module scope. Declare background location and obtain permission
// before calling location.startUpdates('trip').Typdeklaration
export type LocationTaskRun = {
name: string;
/** When the platform stops waiting for the run, in milliseconds since the epoch. */
deadline: number;
locations: LocationObject[];
};Mitglieder 3
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
name | string | Ja | — |
deadline | number | Ja | When the platform stops waiting for the run, in milliseconds since the epoch. |
locations | Fix[] | Ja | — |
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.