location.LocationTaskRun
What a location task receives: the fixes since its last run, oldest first.
Utilização
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').Declaração do tipo
export type LocationTaskRun = {
name: string;
/** When the platform stops waiting for the run, in milliseconds since the epoch. */
deadline: number;
locations: LocationObject[];
};Membros 3
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
name | string | Sim | — |
deadline | number | Sim | When the platform stops waiting for the run, in milliseconds since the epoch. |
locations | Fix[] | Sim | — |
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.